Travel query method and system and terminal equipment
Through the query request mechanism triggered by a specific event, the number of query times of terminal equipment and information management equipment is reduced, which solves the problems of large power consumption of terminal equipment and high load of information management equipment, and achieves lower power consumption and load.
Patent Information
- Application Number
- CN202410039808.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-10
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, terminal equipment frequently sends query requests to obtain updated train trip information, resulting in large power consumption of mobile phones, increasing the load of information management equipment, and increasing the possibility of abnormalities in information management equipment.
When the terminal device detects a specific event (such as entering the target location range or closing the travel APP), the third-party query device adds it to the keep-alive queue and sends a second query request to the information management device after cooling time, reducing the number of queries.
By reducing the number of query times of terminal equipment and information management equipment, the power consumption of terminal equipment and the load of information management equipment are reduced, and the risk of equipment abnormalities is reduced.
Smart Images

Figure CN120336374A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to a travel query method, system, and terminal device. Background Art
[0002] Currently, the services provided by mobile phones to users are becoming more and more personalized. For example, any APP in a mobile phone can provide services such as schedule reminders and travel reminders for users. The travel reminder may include a reminder about travel information (for example, train travel information). To implement the reminder about travel information, in the prior art, any APP sends a query request including user information to a third-party query device. After receiving the query request, the third-party query device can forward the query information to an information management device; in response to the query request, the information management device determines the real-time train travel information corresponding to the user information and returns it.
[0003] Since the train travel information of a user may be updated at any time, to ensure the real-time nature of the train travel reminder, any APP will frequently send query requests to obtain the latest train travel information of the user. Frequent sending of query requests by any APP will result in a relatively high power consumption of the mobile phone. Secondly, when any APP frequently sends query requests, the number of query requests that the information management device needs to process becomes larger, which may cause an excessive load on the information management device. This may lead to a situation where the information management device restricts the number of query times or the information management device crashes.
[0004] In summary, the existing technology for querying train travel information has problems of relatively high power consumption of the mobile phone and relatively large load on the information management device. This further increases the possibility of a failure of the information management device. Summary of the Invention
[0005] Embodiments of this application provide a travel query method, system, and terminal device, which can ensure that the terminal device timely obtains updated travel information and reduces the number of first query requests sent by the terminal device to a third-party query device. Thereby reducing the power consumption of the terminal device. Reducing the number of first query requests sent by the terminal device to a third-party query device can reduce the number of query requests that the information management device needs to process, thereby reducing the load on the information management device.
[0006] To achieve the above object, the embodiments of this application adopt the following technical solutions:
[0007] In a first aspect, a travel query method is provided. This method is applied to a travel query system, which may include a terminal device, a third-party query device, and an information management device. The method includes: when the terminal device determines that a first event has occurred, it sends a first query request to the third-party query device; then, in response to the first query request, the third-party query device adds the information to be queried to a preset keep-alive queue; when the information to be queried meets the query conditions, the third-party query device sends a second query request to the information management device; in response to the second query request, the information management device sends the first travel information corresponding to the information to be queried to the third-party query device; and the third-party query device sends the first travel information to the terminal device.
[0008] Among them, the first query request includes the information to be queried. The first event includes at least one of the following: the terminal device enters the target location range, and the target travel application in the terminal device is closed. The second query request includes the information to be queried; the query condition includes that the first duration is greater than the cooling duration. The first duration is the waiting processing duration of the information to be queried.
[0009] It can be understood that the first event may include at least one of the following: the terminal device enters the target location range, closes the target travel application, and closes the target travel application. The occurrence of any one of the first events indicates a high possibility that the user updates the travel information. Therefore, sending the first query request when the first event occurs can ensure that the terminal device timely obtains the updated travel information. Secondly, compared with the terminal device frequently sending the first query request, the terminal device only sends the first query request when the first event occurs. Adopting this solution can reduce the number of times the terminal device sends the first query request to the third-party query device. Thus, the power consumption of the terminal device is reduced.
[0010] Secondly, adopting this solution to reduce the number of times the terminal device sends the first query request to the third-party query device can reduce the number of times the third-party query device sends the second query request to the information management device. Thus, the number of query requests to be processed by the information management device is reduced, and the load on the information management device is reduced.
[0011] Furthermore, after receiving the first query request, the third-party query device first adds the first query request to a preset keep-alive queue, and then sends a second query request to the information management device based on the first query request after waiting for the cooling duration to request the query of travel information. If multiple first events occur in the terminal device within the cooling duration, the third-party query device only needs to send a second query request to the information management device once, reducing the number of query requests to be processed by the information management device. Thus, the load on the information management device can be reduced.
[0012] In combination with the first aspect, in a possible implementation, the target location range includes: the location information of the area where the target railway station is located; the target travel APP includes: an APP for managing train services, and an APP for managing the services of multiple transportation means.
[0013] This real-time mode describes an application scenario of the itinerary query method provided by the embodiments of the present application, that is, the itinerary query method can be applied to the scenario of querying train itinerary information.
[0014] In combination with the first aspect, in another possible implementation, the method further includes: when the information to be queried meets the query condition, the third-party query device obtains the second itinerary information corresponding to the information to be queried from the historical traffic information stored locally; when the second itinerary information includes the third itinerary information and the terminal device is located at the target railway station, the third-party query device deletes the information to be queried from the preset keep-alive queue. The third itinerary information is the itinerary information with the departure time on the same day and the departure place being the target railway station.
[0015] It can be understood that if the second itinerary information corresponding to the information to be queried includes the third itinerary information with the departure time on the same day and the departure place of the third itinerary information being the target railway station where the terminal device is currently located, it means that the terminal device is currently located at the departure station of the itinerary on the same day. Although the first event has occurred, but the terminal device is currently located at the departure station of the itinerary on the same day, it can be known that the possibility of the user updating the itinerary information is also relatively small. Furthermore, the third-party query device can delete the information to be queried from the preset keep-alive queue, that is, the third-party query device does not request the information management device to obtain the itinerary information corresponding to the information to be queried, which can reduce the number of query requests to be processed by the information management device.
[0016] In combination with the first aspect, in another possible implementation, the method further includes: when the information to be queried meets the query condition, the third-party query device obtains the second itinerary information corresponding to the information to be queried from the historical traffic information stored locally. The above third-party query device sends the first itinerary information to the terminal device, including: the third-party query device determines whether the itinerary information corresponding to the information to be queried has changed according to the first itinerary information and the second itinerary information; when the itinerary information corresponding to the information to be queried has changed, the third-party query device sends the first itinerary information to the terminal device.
[0017] It can be understood that if the first itinerary information obtained by the third-party query device from the information management device is different from the second itinerary information locally stored by the third-party query device, that is, the itinerary information corresponding to the information to be queried has changed, the third-party query device can send the first itinerary information to the terminal device so that the terminal device can learn the updated itinerary information (i.e., the first itinerary information). If the first itinerary information obtained by the third-party query device from the information management device is the same as the second itinerary information locally stored by the third-party query device, that is, the itinerary information corresponding to the information to be queried has not changed, the third-party query device may not send the old itinerary information (i.e., the first itinerary information) to the terminal device.
[0018] In another possible implementation manner in combination with the first aspect, that the information to be queried meets the query condition further includes: the polling times corresponding to the information to be queried are less than a preset times threshold. The polling times corresponding to the information to be queried are the times when the third-party query device queries the itinerary information corresponding to the information to be queried. The initial value of the polling times corresponding to the information to be queried is 0. The above method further includes: after obtaining the second itinerary information, the third-party query device performs at least one of the following: clearing the first duration to zero, and incrementing the polling times corresponding to the information to be queried by 1.
[0019] It can be understood that the third-party query device clearing the first duration to zero means that after waiting for the cooling duration again (i.e., after the end of a new cooling period of the information to be queried), it requests to query the itinerary information corresponding to the information to be queried, which can reduce the query frequency of the third-party query device for the same information to be queried. Thereby reducing the number of query requests that the information management device has to process.
[0020] In another possible implementation manner in combination with the first aspect, the method further includes: the third-party query device traverses the preset keep-alive queue; when the third-party query device traverses the information to be queried in the preset keep-alive queue and the information to be queried meets the query condition, it determines whether the information to be queried meets the query condition.
[0021] This real-time manner describes that the third-party query device processes each piece of information to be queried in the preset keep-alive queue in turn.
[0022] In another possible implementation manner in combination with the first aspect, the method further includes: when the terminal device determines that a second event has occurred, it sends a cancellation request to the third-party query device; in response to the cancellation request, the third-party query device deletes the information to be queried from the preset keep-alive queue. Wherein, the second event includes the terminal device leaving the target location range; the cancellation request includes the information to be queried.
[0023] It can be understood that when the terminal device leaves the target location range, it indicates a high possibility that the user does not need to obtain travel information. Therefore, the third-party query device can delete the information to be queried from the preset keep-alive queue, that is, end the request to the information management device to query the travel information corresponding to the terminal device, which can reduce the number of query requests to be processed by the information management device. Thus, the load on the information management device can be reduced.
[0024] In combination with the first aspect, in another possible implementation, when the terminal device determines that the first event has occurred, it sends a first query request to the third-party query device, including: when the terminal device determines that the first event has occurred, it sends a first query request to the third-party query device after a first delay duration.
[0025] It can be understood that if the first event occurs multiple times within the first delay duration, the travel query module in the terminal device can send only one first query request to the third-party query device, achieving a reduction in the number of first query requests sent by the terminal device, and thus reducing the power consumption of the terminal device.
[0026] In combination with the first aspect, in another possible implementation, the method further includes: the terminal device receives the first travel information, determines the travel information to be recommended from the first travel information, and displays a card, where the card includes the travel information to be recommended.
[0027] This real-time method describes a way for the terminal device to output the travel information to be recommended.
[0028] In a second aspect, a travel query method is provided, which is applied to a terminal device. The method includes: when the terminal device determines that the first event has occurred, it sends a first query request to the third-party query device; the terminal device receives the first travel information sent by the third-party query device. Among them, the first query request includes the information to be queried, and the first query request is used to request to query the travel information corresponding to the information to be queried; the first event includes at least one of the following: the terminal device enters the target location range, and the target travel application in the terminal device is closed.
[0029] In combination with the first aspect, in a possible implementation, the target location range includes: the location information of the area where the target railway station is located; the target travel application includes: an application for managing train services, and an application for managing services of multiple transportation means.
[0030] In combination with the first aspect, in another possible implementation, the above method further includes: when the terminal device determines that the second event has occurred, it sends a cancellation request to the third-party query device; the second event includes the terminal device leaving the target location range; the cancellation request includes the information to be queried, and the cancellation request is used to request to end the query of the travel information corresponding to the information to be queried.
[0031] In combination with the first aspect, in another possible implementation, when the above terminal device determines that the first event has occurred, it sends a first query request to the third-party query device, including: when the terminal device determines that the first event has occurred, it waits for a first delay duration and then sends a first query request to the third-party query device.
[0032] In combination with the first aspect, in another possible implementation, the above method further includes: the terminal device receives first trip information, determines the trip information to be recommended from the first trip information, and displays a card, where the card includes the trip information to be recommended.
[0033] It should be noted that the technical effects brought by any design method in the second aspect can be referred to the technical effects brought by the same or similar design methods in the first aspect, which will not be elaborated here.
[0034] In a third aspect, a trip query system is provided, which includes: a terminal device, a third-party query device, and an information management device; the terminal device, the third-party query device, and the information management device are used to execute the method described in any item of the first aspect above.
[0035] Among them, the technical effects brought by any design method in the third aspect can be referred to the technical effects brought by different design methods in the first aspect, which will not be elaborated here.
[0036] In a fourth aspect, a terminal device is provided, which includes: a processor, a memory, and a communication interface. The memory and the communication interface are coupled to the processor, and the memory is used to store computer program code, and the computer program code includes computer instructions. Among them, when the processor executes the computer instructions, the terminal device is caused to execute the method described in any item of the second aspect above.
[0037] Among them, the technical effects brought by any design method in the fourth aspect can be referred to the technical effects brought by different design methods in the second aspect, which will not be elaborated here.
[0038] In a fifth aspect, a computer-readable storage medium is provided, in which computer instructions are stored. When the computer instructions run on the trip query system, the trip query system is caused to execute the method described in any item of the first aspect above. Or, when the computer instructions run on the terminal device, the terminal device is caused to execute the method described in any item of the second aspect above.
[0039] In a sixth aspect, there is provided a computer program product containing computer instructions, which, when running on a trip query system, cause the trip query system to execute the method described in any one of the above first aspects. Alternatively, when the computer instructions run on a terminal device, they cause the terminal device to execute the method described in any one of the above second aspects.
[0040] Among them, for the technical effects brought by any one of the design methods in the fifth aspect and the sixth aspect, reference can be made to the technical effects brought by different design methods in the first aspect to the third aspect, which will not be elaborated here. Description of the Drawings
[0041] Figure 1 Schematic diagram of an application scenario of a trip query method provided by an embodiment of the present application;
[0042] Figure 2 Schematic diagram of the structure of a terminal device provided by an embodiment of the present application;
[0043] Figure 3 Software structure diagram of a terminal device provided by an embodiment of the present application;
[0044] Figure 4 Flow of a trip query method provided by an embodiment of the present application Figure 1 ;
[0045] Figure 5 Flow of a trip query method provided by an embodiment of the present application Figure 2 ;
[0046] Figure 6 Schematic diagram of the structure of a chip system provided by an embodiment of the present application. Detailed Embodiments
[0047] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present application.
[0048] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, unless otherwise specified, "a plurality of" means two or more.
[0049] Currently, the services provided by terminal devices to users are becoming more and more personalized. For example, any application (APP) in a terminal device can provide services such as schedule reminders and travel reminders for users. The travel reminder can include a reminder about trip information (or simply referred to as a travel itinerary reminder). The terminal device needs to obtain trip information (such as the origin, destination, departure time, etc.) to implement the travel itinerary reminder. Optionally, the trip information can include train travel information (such as the train origin, train destination, and train departure time, etc.). A reminder about train travel information can be called a train itinerary reminder.
[0050] Please refer to Figure 1 , which is a schematic diagram of an application scenario of a trip query method provided by an embodiment of this application. The process for the terminal device to obtain trip information can include: Any APP in the terminal device 110 sends a query request including user information to the third-party query device 120. After receiving the query request, the third-party query device 120 can forward the query information to the information management device 130; in response to the query request, the information management device 130 determines the trip information corresponding to the user information and returns it.
[0051] Since the user's trip information may be updated at any time, in order to ensure timely acquisition of the updated trip information, in the prior art, the terminal device 110 will frequently send query requests to obtain the latest trip information of the user. Frequent sending of query requests by the terminal device 110 will result in a relatively high power consumption of the terminal device. Secondly, when the terminal device 110 frequently sends query requests, the number of query requests that the information management device 130 needs to process becomes larger, resulting in an excessive load on the information management device 130. Once the load on the information management device 130 is excessive, the possibility of the information management device 130 experiencing abnormal conditions (such as the information management device 130 restricting the number of query requests of the terminal device 110, the information management device 130 crashing) is greatly increased.
[0052] In summary, the technical solution provided by the prior art increases the power consumption of the terminal device and also increases the load on the information management device 130, thereby increasing the possibility of the information management device 130 experiencing abnormal conditions.
[0053] In view of the above problems, an embodiment of the present application proposes a travel query method. The terminal device 110 can first listen for a first event. When the first event occurs, the terminal device 110 sends a first query request to the third-party query device 120. In response to the first query request, the third-party query device 120 can first add the first query request to a preset keep-alive queue; when the duration for which the first query request is added to the preset keep-alive queue exceeds the cooling duration, then based on the first query request, it sends a second query request to the information management device 130; in response to the second query request, the information management device 130 sends the first travel information to the third-party query device 120. The third-party query device 120 can send the first travel information to the terminal device 110.
[0054] Among them, the first event may include at least one of the following: the terminal device 110 enters the target location range, closes the target travel application, and closes the target travel application. The occurrence of any one of the first events indicates a high possibility that the user updates the travel information. Therefore, sending the first query request when the first event occurs can ensure that the terminal device 110 timely obtains the updated travel information. Secondly, compared with the prior art in which the terminal device 110 frequently sends the first query request, the terminal device 110 only sends the first query request when the first event occurs. Adopting this solution can reduce the number of times the terminal device 110 queries the travel information. Furthermore, the number of times the third-party query device 120 sends the second query request to the information management device 130 can be reduced. Reducing the number of times the second query request is sent to the information management device 130 reduces the number of query requests that the information management device 130 has to process, and can achieve reducing the load of the information management device 130.
[0055] Further, after receiving the first query request, the third-party query device 120 first adds the first query request to the preset keep-alive queue, waits for the cooling duration, and then based on the first query request, sends a second query request to the information management device 130 to request a query of the travel information. If multiple first events occur on the terminal device 110 within the cooling duration, the third-party query device 120 only needs to send a second query request to the information management device 130 once, reducing the number of query requests that the information management device 130 has to process, and can achieve reducing the load of the information management device 130.
[0056] In some examples, the terminal device 110 may be an electronic device such as a mobile phone, a tablet computer, a smart watch, and a wearable device. The third-party query device 120 may be an electronic device that provides cloud services. The information management device 130 may also be an electronic device that includes providing cloud services. Among them, cloud services refer to various services provided through the Internet, such as cloud storage, cloud computing, cloud servers, etc.
[0057] Optionally, the terminal device 110 and the third-party query device 120 can communicate through cloud services. For example, the terminal device 110 can send communication information to the cloud service of the third-party query device 120 through a wireless network to send communication information to the third-party query device 120. Similarly, the third-party query device 120 can also send communication information to the cloud service of the terminal device 110 through a wireless network to send communication information to the terminal device 110.
[0058] It should be noted that the embodiments of the present application do not limit the specific forms of the terminal device 110, the third-party query device 120, and the information management device 130.
[0059] Exemplarily, taking the terminal device 110 as a mobile phone as an example, Figure 2 shows a schematic structural diagram of a terminal device provided by an embodiment of the present application. As Figure 2 shown, the mobile phone may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. Among them, the sensor module 280 may include a pressure sensor, a touch sensor, etc.
[0060] It can be understood that the structure illustrated in this embodiment does not specifically limit the mobile phone. In other embodiments, the mobile phone may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0061] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), and a controller, etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0062] The controller can be the nerve center and command center of the mobile phone. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
[0063] A memory can also be set in the processor 210 to store instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can save the instructions or data that the processor 210 has just used or recycled. If the processor 210 needs to use the instruction or data again, it can directly call it from this memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0064] In some embodiments, the interfaces included in the processor 210 can be divided into hardware interfaces and software interfaces. Among them, the hardware interface refers to the physical interface on the mobile phone for connecting external devices or transmitting data. For example, an inter-integrated circuit (I2C) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. The software interface can include the interface between the mobile phone operating system and the APP, which is used to realize data exchange and function calls between application programs. Usually, the form of the software interface is an application programming interface (API).
[0065] Exemplarily, as Figure 3 shown, the mobile phone can include a software development kit (SDK) provided by the third-party query device 120. The SDK provided by the third-party query device 120 can be simply referred to as the third-party query SDK. This third-party query SDK provides a set of APIs and related documents, etc., enabling the mobile phone to use these APIs to communicate and interact with the third-party query device 120.
[0066] The charging management module 240 is used to receive charging input from the charger. While charging the battery 242, the charging management module 240 can also supply power to the mobile phone through the power management module 241.
[0067] The wireless communication function of the mobile phone can be implemented through antenna 1, antenna 2, the mobile communication module 250, the wireless communication module 260, the modulation and demodulation processor, and the baseband processor, etc.
[0068] Antenna 1 and Antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the mobile phone can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, Antenna 1 can be multiplexed as a diversity antenna for a wireless local area network.
[0069] The mobile communication module 250 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the mobile phone. The mobile communication module 250 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves through Antenna 1, filter, amplify, and process the received electromagnetic waves, and then transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through Antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 250 can be disposed in the processor 210. In some embodiments, at least some functional modules of the mobile communication module 250 and at least some modules of the processor 210 can be disposed in the same device.
[0070] The wireless communication module 260 can provide solutions for wireless communications such as wireless local area networks (WLAN), global navigation satellite system (GNSS), etc. applied to the mobile phone. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves through Antenna 2, frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 can also receive the signal to be transmitted from the processor 210, frequency-modulate and amplify it, and convert it into electromagnetic waves through Antenna 2 for radiation.
[0071] In some embodiments, the antenna 1 of the mobile phone is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the mobile phone can communicate with the network and other devices (e.g., the third-party query device 120, the information management device 130) through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), GNSS, and WLAN, etc.
[0072] Among them, the mobile phone can obtain its own location information through GNSS or the mobile communication network. Among them, GNSS may include global positioning system (GPS), and / or beidou navigation satellite system (BDS), etc.
[0073] For example, the location information of the terminal device 110 in the embodiments of the present application may be the longitude and latitude coordinates obtained by using GPS or BDS.
[0074] Alternatively, the terminal device 110 can also obtain its own location information through the mobile communication network (or called the cellular network). Specifically, the mobile communication network includes multiple base stations. The terminal device 110 communicates with the nearest base station and receives the base station information sent by the base station; then compares the base station information with the base station information stored locally to determine the location range where the terminal device 110 is located.
[0075] If the display screen 294 in the embodiments of the present application integrates a touch sensor, the display screen 294 can be referred to as a touch screen. This touch sensor can also be called a "touch control panel". That is to say, the display screen 294 can include a display panel and a touch panel. The touch sensor is used to detect touch operations acting on or near it. After the touch sensor detects a touch operation (such as the above-mentioned user operation), it can trigger the driver of the mobile phone kernel layer to periodically scan the touch parameters generated by the touch operation. Then, the driver of the kernel layer passes the touch parameters to the relevant modules in the upper layer, so that the relevant modules can determine the touch event corresponding to the touch parameters. In the embodiments of the present application, taking the display screen 294 as a display screen integrated with a touch sensor (i.e., a touch screen) as an example, the specific process of the itinerary query method provided in the embodiments of the present application is described.
[0076] The mobile phone realizes the display function through the GPU, the display screen 294, and the AP, etc. The mobile phone can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294, and the AP, etc.
[0077] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone. The internal memory 221 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 210 executes various functional applications and data processing of the mobile phone by running the instructions stored in the internal memory 221.
[0078] The mobile phone can realize the audio function through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the AP, etc.
[0079] The keys 290 include a power-on key, a volume key, etc. The motor 291 can generate a vibration prompt. The indicator 292 can be an indicator light, which can be used to indicate the charging state, the change in battery power, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 295 is used to connect the SIM card.
[0080] The software system of the above mobile phone can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present application, taking the system of the layered architecture as an example, the structure of the software system of the mobile phone is exemplarily described. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through interfaces.
[0081] In some embodiments, as Figure 3 shown, The system is divided into four layers, from top to bottom are the application layer, the application framework layer (or called the framework layer framework), the hardware abstraction layer (hardware abstraction layer, HAL), the driver layer (or called the kernel layer), and the hardware layer. The layers communicate with each other through software interfaces.
[0082] Among them, the APP layer can include a series of APPs. This series of APPs can be divided into the system APPs pre-installed on the mobile phone and the third-party APPs downloaded by users to the mobile phone. For example, as Figure 3 shown, the system APPs can include the yoyo APP and the system camera APP, etc.; the third-party APPs can include: shopping APPs and travel APPs. Among them, the travel APPs can include: comprehensive information management APPs for multiple means of transportation, train information management APPs, and so on. The yoyo APP is an intelligent assistant APP used to provide some personalized services for users, such as schedule reminders, travel reminders, home appliance management, etc.
[0083] The framework layer provides APIs and programming frameworks for a series of APPs in the APP layer. The framework layer includes some predefined functions. For example, the framework layer can include third-party query access interfaces (i.e., third-party query APIs), APP life cycle awareness services, location awareness services, and view systems, etc. The embodiments of the present application do not make any restrictions on this.
[0084] Among them, the third-party query API is the API provided by the third-party query SDK, and the mobile phone can use the third-party query API to communicate and interact with the third-party query device 120.
[0085] Among them, the APP life cycle awareness service mainly monitors the state changes of APPs by listening to the life cycle events of the mobile phone, such as the startup, pause, resume, stop, etc. of the APP.
[0086] Among them, the location awareness service can provide a location access interface, and the location access interface is used to provide an application programming interface and a programming framework for APPs. For example, the yoyo APP can interact with the location awareness module in the mobile phone through the location access interface to receive the location signals obtained by the location awareness module. Among them, the location awareness module can include: positioning chips (such as GPS chips, Beidou chips), cellular network modules (for cellular network positioning).
[0087] Among them, the view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to construct the display interface of the APP. The display interface can be composed of one or more views. For example, an interface including travel information, etc.
[0088] The HAL layer is an interface layer located between the kernel layer of the operating system and the hardware layer. Its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable across multiple platforms. The HAL layer provides a standard interface to display the device hardware functions to a higher-level Java API framework (i.e., the framework layer). The HAL layer contains multiple library modules, and each module implements an interface for a specific type of hardware component. For example, the HAL layer includes a display HAL, which is responsible for interacting with the hardware device (e.g., the display screen) that implements the display function in the mobile phone. Another example is that the HAL layer also includes a location-aware HAL, which is responsible for interacting with the hardware device (e.g., the location-aware module) that implements the location determination function in the mobile phone.
[0089] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, etc., which is not limited in this application. The display driver is used to control the display of the monitor.
[0090] Combined Figure 3 , please refer to Figure 4 , an itinerary query method provided by an embodiment of this application can be applied to an itinerary query system. As Figure 4 shown, the itinerary query system may include: a terminal device 110, a third-party query device 120, and an information management device 130. Among them, the terminal device 110 may include: a yoyo APP and a sensing module. The yoyo APP may include an itinerary query module. As Figure 4 shown, an itinerary query method provided by an embodiment of this application may include S401 - S411.
[0091] S401. The itinerary query module sends an event subscription message to the sensing module; the event subscription message is used to request to learn about a first event and a second event; the first event includes at least one of the following: the terminal device 110 enters a target location range and closes a target travel class APP; the second event includes the terminal device 110 leaving the target location range.
[0092] When the terminal device 110 runs the yoyo APP, the itinerary query module in the yoyo APP can request the sensing module to obtain messages about the first event and the second event. For example, the itinerary query module sends an event subscription message to the sensing module to request to obtain messages about the first event and the second event. Optionally, the itinerary query module can be a function plug-in for assisting in obtaining itinerary information.
[0093] It can be understood that the occurrence of any one of the first events (for example, the terminal device 110 enters the target location range, or closes the target travel application) indicates a relatively high possibility that the user updates the travel information. The occurrence of the terminal device 110 leaving the target location range in the second event indicates a relatively high possibility that the user does not need to obtain the travel information.
[0094] Exemplarily, the target travel application may include at least one of the following: at least one comprehensive information management application, and the information management application of any one transportation vehicle. Among them, the comprehensive information management application can provide business management functions for multiple transportation vehicles. The information management application of any one transportation vehicle is used to provide business management functions for any one transportation vehicle (for example, the management function of flight services, or the management function of train services), and the information management device 130 can be used to provide services for the information management application of any one transportation vehicle.
[0095] In some embodiments, the sensing module may include the above-mentioned APP lifecycle sensing service. The travel query module sending an event subscription message to the sensing module may include: the travel query module sending an event subscription message to the APP lifecycle sensing service to request subscribing to the APP lifecycle fence. The travel query module subscribes to the APP lifecycle fence to obtain the lifecycle events of the target travel application detected by the APP lifecycle sensing service. Among them, each APP in the terminal device 110 has different lifecycle stages during operation, such as startup, pause, resume, shutdown, etc. The lifecycle events of the target travel application may include: starting, pausing, resuming, or shutting down the target travel application. Shutting down the target travel application may include: switching the target travel application (including switching the target travel application from the foreground to the background, or switching to other applications), and completely terminating the target travel application.
[0096] Exemplarily, the APP lifecycle sensing service may detect the occurrence of shutting down the target travel application through a real-time query interface while the target travel application is being shut down. Or, the APP lifecycle sensing service calls a protection interface to detect the occurrence of shutting down the target travel application. Among them, the process of the APP lifecycle sensing service calling the protection interface to detect the occurrence of shutting down the target travel application may include: the target travel application maintains a certain active state when it is being shut down, and the APP lifecycle sensing service interacts with the target travel application to determine that the target travel application has been shut down.
[0097] Further, the perception module may further include the above-mentioned location perception module. The itinerary query module sending an event subscription message to the perception module may further include: the itinerary query module also sending an event subscription message to the location perception module to request to learn that the terminal device 110 enters the target location range and that the terminal device 110 leaves the target location range.
[0098] In some embodiments, the location perception module determining whether the terminal device 110 enters the target location range and determining whether the terminal device 110 leaves the target location range may include: continuously acquiring the location information of the terminal device 110; and then, based on the multiple location information of the terminal device 110 and the location information of the area where the target railway station is located, determining whether the terminal device 110 enters the target location range and determining whether the terminal device 110 leaves the target location range. The target location range includes the location information of the area where the target location is located. For example, the location information of the area where the target railway station is located (or referred to as the railway station geofence).
[0099] Exemplarily, the terminal device 110 communicates with a base station near the terminal device 110 to receive the base station information sent by the nearby base station. The terminal device 110 then compares the received base station information with the target base station information stored locally to determine whether the terminal device 110 is within the target location range. If the base station information belongs to the target base station information, the terminal device 110 may determine that the terminal device 110 is within the target location range; if the base station information does not belong to the target base station information, the terminal device 110 may determine that the terminal device 110 is outside the target location range. Further, the terminal device 110 may continuously receive multiple pieces of base station information, and then, based on multiple judgment results obtained from the multiple pieces of base station information, determine whether the terminal device 110 enters the target location range and determine whether the terminal device 110 leaves the target location range.
[0100] Among them, the target base station information may be the base station information sent by a target base station located within the area where the target railway station is located.
[0101] S402. In response to the event subscription message, the perception module sends a first event identifier to the itinerary query module when the first event occurs.
[0102] The perception module may acquire messages about the first event and the second event in real time, and may send the first event identifier corresponding to the first event to the itinerary query module when the first event occurs. The first event identifier is used to indicate that the first event occurs.
[0103] S403. Based on the first event identifier, the itinerary query module sends a first query request to the third-party query device 120, and the first query request includes the information to be queried.
[0104] In response to the first event identifier, the itinerary query module can obtain the information to be queried; then generate a first query request based on the information to be queried. Then, the itinerary query module sends the first query request to the third-party query device 120. Optionally, as Figure 4 shown, the itinerary query system may further include: a first cloud service for providing services to the third-party query device 120. Furthermore, the itinerary query module can send the first query request to the third-party query device 120 through the first cloud service.
[0105] In some embodiments, the information to be queried may include: the device identifier (openId) of the terminal device 110, and the user information (such as the mobile phone number) logged in to the yoyo APP in the terminal device 110.
[0106] In some embodiments, after receiving the first event identifier, the itinerary query module can wait for a first delay duration (for example, 30 seconds) and then send the first query request to the third-party query device 120. In this way, if the first event occurs multiple times within the first delay duration, the itinerary query module in the terminal device 110 can send the first query request to the third-party query device 120 only once, reducing the number of first query requests sent by the terminal device 110, and thus reducing the power consumption of the terminal device 110.
[0107] S404. In response to the first query request, the third-party query device 120 adds the information to be queried to the preset keep-alive queue.
[0108] In response to the first query request, the third-party query device 120 can add the information to be queried to the preset keep-alive queue and generate a timestamp corresponding to the information to be queried. The preset keep-alive queue can be used to store multiple pieces of information to be queried, and can also store the timestamps corresponding to each piece of information to be queried among the multiple pieces of information to be queried. The third-party query device 120 can traverse the preset keep-alive queue, and for each piece of information to be queried traversed, request to query the itinerary information corresponding to the information to be queried when the query conditions are met.
[0109] Among them, different pieces of information to be queried in the preset keep-alive queue can be sent by different terminal devices. The following embodiments will illustrate the itinerary query method provided by the embodiments of the present application by taking the information to be queried sent by the terminal device 110 as an example.
[0110] Optionally, the third-party query device 120 can generate a timestamp corresponding to the information to be queried based on the time when the information to be queried is added to the preset keep-alive queue.
[0111] Optionally, the third-party query device 120 may traverse a preset keep-alive queue once within a preset traversal duration. The value of the preset traversal duration depends on the processing ability of the third-party query device 120. For example, the preset traversal duration may be 1 minute. In this case, the preset keep-alive queue may be referred to as a minute-level keep-alive queue.
[0112] Optionally, in response to the first query request, when the information to be queried of the terminal device 110 is added to the preset keep-alive queue for the first time, the third-party query device 120 may wait for a second delay duration (for example, 30 seconds) and then add the information to be queried to the preset keep-alive queue to avoid the information to be queried of the terminal device 110 being added to the preset keep-alive queue due to the user's accidental touch.
[0113] S405. When the first duration is greater than the cooling duration, the third-party query device 120 sends a second query request to the information management device 130; the first duration is the waiting processing duration of the information to be queried, and the second query request includes the information to be queried.
[0114] When the third-party query device 120 traverses the information to be queried in the preset keep-alive queue, it may determine whether the information to be queried meets the query conditions. If the information to be queried meets the query conditions, the third-party query device 120 may send a second query request to the information management device 130, and the second query request is used to request to query the trip information corresponding to the information to be queried. If the information to be queried does not meet the query conditions, wait for the third-party query device 120 to traverse the information to be queried next time. Optionally, the query conditions may include: the first duration of the information to be queried is greater than the cooling duration. Furthermore, the third-party query device 120 may send a second query request to the information management device 130 when the first duration exceeds the cooling duration.
[0115] Exemplarily, the cooling duration may be equal to several minutes, for example, 3 minutes.
[0116] It can be understood that the cooling duration set by the third-party query device 120 can extend the duration for sending the second query request to the information management device 130. Furthermore, during the period when the first duration of the information to be queried is less than the cooling duration (i.e., the information to be queried is in the cooling period), if the terminal device 120 sends the information to be queried again, for multiple pieces of information to be queried sent by the terminal device 120, the third-party query device 120 may send a second query request to the information management device 130 once, reducing the number of query requests to be processed by the information management device 130 and achieving a reduction in the load of the information management device 130.
[0117] Optionally, the third-party query device 120 may generate a timestamp corresponding to the information to be queried based on the time when the information to be queried joins the preset keep-alive queue. Further, after the third-party query device 120 executes a request to query the itinerary information corresponding to the information to be queried, the third-party query device 120 may update the timestamp corresponding to the information to be queried to the current time.
[0118] Optionally, the first duration may be equal to the time difference between the current time and the timestamp corresponding to the information to be queried. Wherein, when the timestamp corresponding to the information to be queried is equal to the time when the information to be queried joins the preset keep-alive queue, the first duration may be equal to the duration when the information to be queried joins the preset keep-alive queue. When the third-party query device 120 updates the timestamp corresponding to the information to be queried, and the updated timestamp is not equal to the time when the information to be queried joins the preset keep-alive queue, the first duration is also not equal to the duration when the information to be queried joins the preset keep-alive queue.
[0119] In some embodiments, in addition to the first duration of the information to be queried being greater than the cooling duration, the above query condition may further include: the polling times corresponding to the information to be queried being less than the preset times threshold. Optionally, the initial value of the polling times corresponding to the information to be queried may be 0. The polling times corresponding to the information to be queried may be used to indicate the number of times the third-party query device 120 queries the itinerary information corresponding to the information to be queried, and when a query of the itinerary information corresponding to the information to be queried occurs once, the polling times corresponding to the information to be queried is incremented by 1. The preset times threshold may be a value greater than 1, for example, 3, 5, 8, 10.
[0120] Wherein, the third-party query device 120 querying the itinerary information corresponding to the information to be queried may include: the third-party query device 120 querying the first itinerary information corresponding to the information to be queried, or the third-party query device 120 querying the second itinerary information corresponding to the information to be queried.
[0121] Further, S405 may include: when the first duration is greater than the cooling duration and the polling times corresponding to the information to be queried is less than the preset times threshold, the third-party query device 120 sends a second query request to the information management device 130. The third-party query device 120 also increments the polling times corresponding to the information to be queried by 1.
[0122] S406. In response to the second query request, the information management device 130 sends the first itinerary information corresponding to the information to be queried to the third-party query device 120.
[0123] The information management device 130 may obtain the first itinerary information corresponding to the information to be queried from the stored real-time traffic information (or referred to as the first traffic comprehensive information) according to the information to be queried in the second query request.
[0124] Among them, the real-time traffic information may include multiple traffic ticket information and multiple traffic travel information. Correspondingly, the first travel information may include at least one of the following: the first traffic ticket information corresponding to the information to be queried, the travel information of the transportation means in the first traffic ticket information (for example, information such as the suspension of the transportation means, the delay of the transportation means, etc.).
[0125] In some embodiments, the real-time traffic information stored in the information management device 130 is updated in real time and dynamically. The information management device 130 may receive an operation to update the traffic information and, in response to the operation to update the traffic information, update the real-time traffic information. Optionally, the real-time traffic information may include at least one of the following: real-time train information and real-time flight information, etc. The real-time train information may include multiple train ticket information and multiple train travel information. The real-time flight information may include multiple airplane ticket information and multiple airplane travel information.
[0126] For example, taking the real-time train information as an example to illustrate the process of updating the real-time transportation means, the terminal device 110 receives an operation 1 input by the user on the target travel application to update the train ticket, and in response to the operation 1, sends the updated travel information to the information management device 130. Then, the information management device 130 updates the real-time train information based on the newly created travel information. Among them, updating the train ticket may include: creating a new train ticket, modifying an existing train ticket, etc.
[0127] Another example, continuing to take the real-time train information as an example to illustrate the process of updating the real-time transportation means, another terminal device receives an operation 2 input by the user to update the travel information of any one train, and in response to the operation 2, sends the updated train travel information to the information management device 130. Then, the information management device 130 updates the real-time train information based on the updated train travel information.
[0128] S407. When the third-party query device 120 determines that the travel information corresponding to the information to be queried has changed, it pushes the first travel information to the yoyo APP.
[0129] After receiving the first travel information, the third-party query device 120 may obtain the second travel information corresponding to the information to be queried from the historical traffic information (or called the second traffic comprehensive information) stored locally; then compare whether the first travel information and the second travel information are consistent. If the first travel information and the second travel information are consistent, it means that the travel information corresponding to the information to be queried has not changed, then the third-party query device 120 may not push the first travel information. If the first travel information and the second travel information are inconsistent, it means that the travel information corresponding to the information to be queried has changed, then the third-party query device 120 may push the first travel information to the yoyo APP.
[0130] Optionally, the historical traffic information may include at least one of the following: historical train information and historical aircraft information. If the first itinerary information is obtained from the real-time train information, the third-party query device 120 obtains the second itinerary information from the historical train information. If the first itinerary information is obtained from the real-time aircraft information, the third-party query device 120 obtains the second itinerary information from the historical aircraft information.
[0131] In some embodiments, as Figure 4 shown, in addition to the itinerary query module, the yoyo APP may further include a third-party query SDK. The process by which the third-party query device 120 pushes the first itinerary information to the yoyo APP may include: the third-party query device 120 first sends an itinerary change identifier to the itinerary query module; the itinerary query module sends the itinerary change identifier to the third-party query SDK; based on the itinerary change identifier, the third-party query SDK sends a third query request to the third-party query device 120, and the third query request is used to request to query the updated itinerary information corresponding to the information to be queried; in response to the third query request, the third-party query device 120 sends the first itinerary information to the third-party query SDK.
[0132] Optionally, as Figure 4 shown, the itinerary query system may further include: a second cloud service (for example, Honor Cloud) for providing services to the terminal device 110. The third-party query device 120 sending the itinerary change identifier to the itinerary query module may include: the third-party query device 120 sending the itinerary change identifier to the itinerary query module through the second cloud service.
[0133] Optionally, the third-party query SDK sending the third query request to the third-party query device 120 based on the itinerary change identifier may include: the third-party query SDK detecting the itinerary change identifier sent by the itinerary query module by listening to the message queue (Message Queue); and sending the first itinerary information to the third-party query device 120 asynchronously.
[0134] Exemplarily, taking the itinerary information to be queried as train travel information as an example, the third query request sent by the third-party query SDK to the third-party query device 120 may be used to request to query the updated train travel information, and the code of the third query request is as follows:
[0135] {
[0136] “corpId”:“13292665”,
[0137] “sign”:“55C127AF”,
[0138] “timeStamp”:“16177777”,
[0139] "token": "********",
[0140] "params": {"openId": "724142156"}
[0141] }
[0142] In response to the third query request, the third-party query device 120 sends the code of the first trip information to the third-party query SDK as follows:
[0143] "appId": null,
[0144] "arrivalStation": "ZAF",
[0145] "arrivalStationName": "Zhengzhou East",
[0146] "arrivalTime": 1662034680,
[0147] "realArrivalTimestamp": "151******80",
[0148] "carriageNumber": "03",
[0149] "checkpoint": "",
[0150] "platform": "North Exit 1",
[0151] "departureStation": "BXP",
[0152] "departureStationName": "Beijing West",
[0153] "departureTime": 1662034680,
[0154] "realDepartureTimeStamp": "151******80",
[0155] "outTripId": null,
[0156] "seatNumber": "Seat No. 01F",
[0157] "startCheckTime": null,
[0158] "status": "Normal",
[0159] "stopCheckTime": null,
[0160] "trainNumber": "G69",
[0161] "userCode": "724142156",
[0162] "seatType": "Second-class seat",
[0163] "orderId": null,
[0164] "travelId": "x7y",
[0165] "useName": "Name",
[0166] "hours": 2.3,
[0167] "miles": 693,
[0168] "hasMeal": 0,
[0169] "hasWifi": 1,
[0170] "trainStop": false,
[0171] S408. The yoyo APP determines the itinerary information to be recommended based on the first itinerary information and outputs the itinerary information to be recommended.
[0172] The yoyo APP can determine part of the itinerary information in the first itinerary information as the itinerary information to be recommended and output it.
[0173] In some embodiments, in addition to the itinerary query module and the third-party query SDK, the yoyo APP may further include an information push module. The yoyo APP determines the itinerary information to be recommended based on the first itinerary information, and outputting the itinerary information to be recommended may include: after receiving the first itinerary information, the third-party query SDK can determine the itinerary information to be recommended from the first itinerary information, and then send the itinerary information to be recommended to the information push module; the information push module can output the itinerary information to be recommended.
[0174] Among them, the information push module can output the itinerary information to be recommended may include: the information push module outputs the itinerary information to be recommended by using a preset output method. For example, the preset output method may include a preset control, and the style of the preset control may be a card style. The information push mode outputs the itinerary information to be recommended by using the preset control, which can also be said to display a card including the itinerary information to be recommended.
[0175] It should be noted that the processes of S401 - S408 above can be referred to as the process of real - time push.
[0176] S409. When the second event occurs, the sensing module sends a second event identifier to the trip query module.
[0177] After receiving the event subscription message sent by the trip query module, when the second event occurs, the sensing module sends a second event identifier to the trip query module. This second event identifier is used to indicate that the second event has occurred.
[0178] S410. Based on the second event identifier, the trip query module sends a cancellation request to the third - party query device 120, and this cancellation request includes the information to be queried.
[0179] Based on the second event identifier, the trip query module can send a cancellation request including the information to be queried to the third - party query device 120; this cancellation request is used to request the cancellation of the trip information corresponding to the information to be queried.
[0180] Optionally, as Figure 4 shown, the trip query module can send a cancellation request to the third - party query device 120 through the first cloud service.
[0181] S411. In response to the cancellation request, the third - party query device 120 deletes the information to be queried from the preset keep - alive queue.
[0182] The third - party query device 120 deleting the information to be queried from the preset keep - alive queue indicates the end of the request to the information management device 130 to query the trip information corresponding to the terminal device 110, which can reduce the number of query requests to be processed by the information management device 130. Thus, the load on the information management device 130 is reduced.
[0183] It should be noted that the processes of S409 - S411 above can be referred to as the process of canceling real - time push.
[0184] Combined with Figure 4 , please refer to Figure 5 , taking the trip information to be queried as train travel information as an example, the trip query method provided by the embodiments of the present application is further introduced. Optionally, the first event may include the terminal device 110 entering the target railway station and the closing event of the target travel - type APP. The second event may include the terminal device 110 leaving the target railway station. As Figure 5 shown, this trip query method may include S501 - S512.
[0185] S501. When the terminal device 110 determines that the terminal device 110 enters the target railway station or determines to close the target travel - type APP, the terminal device 110 sends a first query request to the third - party query device 120, and this first query request includes the information to be queried.
[0186] When the terminal device 110 runs the Youyou APP, it obtains the location information of the terminal device 110 to determine whether the terminal device 110 enters the target railway station; it also determines whether the target travel-related APP (for example, the train information management APP) is closed. Then, when it is determined that the terminal device 110 enters the target railway station or it is determined that the target travel-related APP is closed, a first query request is sent to the third-party query device 120.
[0187] Exemplarily, the itinerary query module in the terminal device 110 may include a train itinerary query module. The third-party query device 120 may include a national railway device. S501 may include the following steps: A1. The train itinerary query module in the terminal device 110 sends an event subscription message to the sensing module in the terminal device 110; A2. In response to the event subscription message, the sensing module sends a first event identifier to the train itinerary query module when the first event occurs; A3. Based on the first event identifier, the train itinerary query module sends a first query request to the national railway device.
[0188] For the specific processes of the above steps A1 - A3, reference may be made to the details of the above introduction about S401 - S403, and the embodiments of the present application will not be elaborated here.
[0189] S502. In response to the first query request, the third-party query device 120 adds the information to be queried to a preset keep-alive queue.
[0190] For the specific process of the above S502, reference may be made to the details of the above introduction about S404, and the embodiments of the present application will not be elaborated here.
[0191] S503. When the third-party query device 120 traverses the information to be queried in the preset keep-alive queue, it determines whether the polling times corresponding to the information to be queried are less than a preset number threshold.
[0192] If the polling times corresponding to the information to be queried are less than the preset number threshold, the third-party query device 120 may continue to determine whether the first duration of the information to be queried is greater than the cooling duration, that is, execute S504. If the polling times corresponding to the information to be queried are greater than or equal to the preset number threshold, the third-party query device 120 may delete the information to be queried from the preset keep-alive queue, that is, execute S512.
[0193] S504. Determine whether the first duration of the information to be queried is greater than the cooling duration.
[0194] If the first duration of the information to be queried is greater than the cooling duration, it indicates that the cooling period of the information to be queried has ended. Then, the third-party query device 120 may request to query the itinerary information corresponding to the information to be queried (for example, train itinerary information), that is, execute S505. If the first duration of the information to be queried is less than or equal to the cooling duration, it indicates that the information to be queried is within the cooling period. Then, the third-party query device 120 may wait to execute S503 - S504 when traversing the information to be queried next time.
[0195] Among them, the third-party query device 120 requesting to query the itinerary information corresponding to the information to be queried may include: obtaining the first itinerary information corresponding to the information to be queried from the information management device 130 (which may be simply referred to as obtaining the first itinerary information), and obtaining the second itinerary information corresponding to the information to be queried from the historical train information stored locally (which may be simply referred to as obtaining the second itinerary information).
[0196] It should be noted that the present application embodiment does not limit the order of the third-party query device 120 obtaining the first itinerary information and the second itinerary information. For example, the third-party query device 120 first obtains the first itinerary information and then obtains the second itinerary information. Another example is that the third-party query device 120 first obtains the second itinerary information and then obtains the first itinerary information. Still another example is that the third-party query device 120 obtains the second itinerary information and the first itinerary information simultaneously. Hereinafter, an example in which the third-party query device 120 first obtains the second itinerary information and then obtains the first itinerary information will be used for introduction.
[0197] S505. The third-party query device 120 obtains the second itinerary information corresponding to the information to be queried from the historical train information stored locally.
[0198] It should be noted that for the specific contents of the historical train information and the second itinerary information (for example, the second train itinerary information) in S505, reference may be made to the details of the introduction of the historical train information and the second itinerary information in S407 above, and the present application embodiment will not elaborate here.
[0199] Optionally, if the terminal device 110 determines that the terminal device 110 enters the target railway station, after S505, it may first determine whether the second itinerary information includes the third itinerary information. The third itinerary information refers to the itinerary information with the departure time on the same day and the departure place being the target railway station. If the second itinerary information includes the third itinerary information, the third-party query device 120 may delete the information to be queried from the preset keep-alive queue, that is, execute S512. If the second itinerary information does not include the third itinerary information, the third-party query device 120 may continue to request the information management device 130 to obtain the itinerary information corresponding to the information to be queried, that is, execute S506.
[0200] It can be understood that if the second itinerary information corresponding to the information to be queried includes third itinerary information with the departure time on the current day, and the departure location of the third itinerary information is the target railway station where the terminal device 110 is currently located, it means that the terminal device 110 is currently located at the departure station of the itinerary on the current day. Although the first event has occurred, but the terminal device 110 is currently located at the departure station of the itinerary on the current day, it can be known that the possibility of the user updating the itinerary information is also relatively small. Furthermore, the third-party query device 120 can delete the information to be queried from the preset keep-alive queue, that is, the third-party query device 120 does not request the information management device 130 to obtain the itinerary information corresponding to the information to be queried, which can reduce the number of query requests that the information management device 130 has to process.
[0201] S506. The third-party query device 120 sends a second query request to the information management device 130, and the second query request is used to request to query the itinerary information corresponding to the information to be queried.
[0202] It should be noted that for the specific content of S503 - S504 and S506, reference can be made to the detailed introduction of the relevant content in S405 above, and the embodiments of the present application will not repeat it here.
[0203] S507. In response to the second query request, the information management device 130 sends the first itinerary information corresponding to the information to be queried to the third-party query device 120.
[0204] The information management device 130 can obtain the first itinerary information (for example, the first train itinerary information) corresponding to the information to be queried from the stored real-time train information according to the information to be queried in the second query request.
[0205] It should be noted that for the specific content of S507, reference can be made to the detailed introduction of S406 above, and the embodiments of the present application will not repeat it here.
[0206] S508. When the third-party query device 120 determines that the itinerary information corresponding to the information to be queried has changed, it pushes the first itinerary information to the terminal device 110.
[0207] Exemplarily, the terminal device 110 includes the Yoyo APP, and the third-party query SDK in the Yoyo APP may include a train query SDK. The process of the third-party query device 120 pushing the first trip information to the terminal device 110 may include: the third-party query device 120 first sends a trip change identifier to the trip query module in the Yoyo APP; the trip query module, based on the trip change identifier, sends a third query request to the train query SDK; the train query SDK, in response to the third query request, sends a fourth query request to the third-party query device 120, where the fourth query request is used to request to query the trip information corresponding to the information to be queried; the third-party query device 120, in response to the fourth query request, sends the first trip information to the train query SDK.
[0208] It should be noted that for the specific content of S508, reference can be made to the above details about S407, and the embodiments of the present application will not elaborate here.
[0209] S509. The terminal device 110 determines the trip information to be recommended based on the first trip information and outputs the trip information to be recommended.
[0210] It should be noted that for the specific content of S509, reference can be made to the above details about S408, and the embodiments of the present application will not elaborate here.
[0211] S510. The third-party query device 120 updates the polling times corresponding to the information to be queried and updates the time stamp corresponding to the information to be queried.
[0212] After S507, the third-party query device 120 may update the polling times corresponding to the information to be queried and update the time stamp corresponding to the information to be queried. Among them, updating the polling times corresponding to the information to be queried may include incrementing the polling times by 1. Updating the time stamp corresponding to the information to be queried may include: changing the time stamp corresponding to the information to be queried to the current moment.
[0213] It can be understood that the first duration of the information to be queried may be equal to the time difference between the current moment and the time stamp corresponding to the information to be queried. The third-party query device 120 changing the time stamp corresponding to the information to be queried to the current moment means that the first duration of the information to be queried is cleared. Furthermore, after waiting for the cooling duration again, that is, after the new cooling period of the information to be queried ends, when the third-party query device 120 traverses the information to be queried again, it can request to query the trip information corresponding to the information to be queried again.
[0214] S511. When the terminal device 110 determines that the terminal device 110 leaves the target railway station, it sends a cancellation request to the third-party query device 120, and the cancellation request includes the information to be queried.
[0215] When the terminal device 110 determines that it has left the target railway station, the sensing module in the terminal device 110 may send a second event identifier to the train itinerary query module; based on the second event identifier, the train itinerary query module then sends a cancellation request to the third-party query device 120, and the cancellation request includes the information to be queried.
[0216] It should be noted that for the specific content of S511, reference can be made to the above introduction details about S409 - S410, and details will not be elaborated here in the embodiments of the present application.
[0217] S512. The third-party query device 120 deletes the information to be queried from the preset keep-alive queue.
[0218] The third-party query device 120 may, in response to the cancellation request, delete the information to be queried from the preset keep-alive queue; or may also delete the information to be queried from the preset keep-alive queue when the second itinerary information corresponding to the information to be queried includes the third itinerary information (i.e., indicating that the terminal device 110 is currently at the starting station of the day's itinerary).
[0219] It should be noted that for the specific content of S512, reference can be made to the above introduction details about S411, and details will not be elaborated here in the embodiments of the present application.
[0220] It can be understood that in order to implement the above functions, the above terminal device (such as a mobile phone) includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed in this article, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0221] The embodiments of the present application can perform function module division on the above electronic devices (for example, the terminal device 110, the third-party query device 120, and the information management device 130) according to the above method examples. For example, each function module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of a software function module. It should be noted that the division of modules in the embodiments of the present invention is illustrative, only a logical function division, and there may be other division methods in actual implementation.
[0222] An embodiment of the present application further provides a terminal device, which includes a processor, a memory, and a communication interface. The memory and the communication interface are coupled to the processor, and the memory is used to store computer program code, and the computer program code includes computer instructions. Wherein, when the processor executes the computer instructions, the terminal device is caused to execute each function or step executed by the terminal device 110 in the above method embodiment.
[0223] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. Wherein, when the computer instructions run on the itinerary query system, the itinerary query system is caused to execute each function or step executed by the itinerary query system (including the terminal device 110, the third-party query device 120, and the information management device 130) in the above method embodiment. Or, when the computer instructions run on the terminal device, the terminal device is caused to execute each function or step executed by the terminal device 110 in the above method embodiment.
[0224] An embodiment of the present application further provides a chip system, as Figure 6 shown, the chip system 600 includes at least one processor 601 and at least one interface circuit 602. The processor 601 and the interface circuit 602 can be interconnected by a line. For example, the interface circuit 602 can be used to receive signals from other devices (such as the memory of an electronic device). Also, for example, the interface circuit 602 can be used to send signals to other devices (such as the processor 601).
[0225] Exemplarily, the interface circuit 602 can read the instructions stored in the memory and send the instructions to the processor 601. When the instructions are executed by the processor 601, the terminal device can be caused to execute each step executed by the terminal device 110 in the above embodiment. Of course, the chip system can also include other discrete devices, and the embodiments of the present application do not make specific limitations on this.
[0226] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional module is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0227] In several embodiments provided in this application, it should be understood that the disclosed devices / apparatuses and methods can be implemented in other ways. For example, the device / apparatus embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0228] The units described as separate components may or may not be physically separated. The components displayed as units can be one physical unit or multiple physical units, that is, they can be located in one place, or they can be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0229] In addition, in each embodiment of this application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0230] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of this application. The foregoing storage medium includes: USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks or optical discs and other various media that can store program codes.
[0231] The above content is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A travel query method, characterized in that, Applied to a trip query system, the trip query system may include a terminal device, a third-party query device, and an information management device. The method includes: When the terminal device determines that a first event occurs, it sends a first query request to the third-party query device; wherein, the first query request includes information to be queried; the first event includes at least one of the following: the terminal device enters a target location range, and closes a target travel application in the terminal device. In response to the first query request, the third-party query device adds the information to be queried to a preset keep-alive queue. When the information to be queried meets the query conditions, the third-party query device sends a second query request to the information management device; wherein, the second query request includes the information to be queried; the query conditions include that a first duration is greater than a cooling duration; the first duration is the waiting processing duration of the information to be queried. In response to the second query request, the information management device sends the first trip information corresponding to the information to be queried to the third-party query device. The third-party query device sends the first trip information to the terminal device.
2. The method according to claim 1, wherein The target location range includes: location information of the area where the target railway station is located; the target travel applications include: an application for managing train services, and an application for managing services of multiple transportation means.
3. The method according to claim 1 or 2, characterized in that, The method further includes: When the information to be queried meets the query conditions, the third-party query device obtains the second trip information corresponding to the information to be queried from the locally stored historical traffic information. When the second trip information includes third trip information and the terminal device is located at the target railway station, the third-party query device deletes the information to be queried from the preset keep-alive queue; wherein, the third trip information is trip information with the departure time on the same day and the departure place being the target railway station.
4. The method according to claim 1 or 2, characterized in that, The method further includes: when the information to be queried meets the query conditions, the third-party query device obtains the second trip information corresponding to the information to be queried from the locally stored historical traffic information. The third-party query device sending the first trip information to the terminal device includes: The third-party query device determines whether the trip information corresponding to the information to be queried has changed according to the first trip information and the second trip information. When the trip information corresponding to the information to be queried has changed, the third-party query device sends the first trip information to the terminal device.
5. The method according to claim 3 or 4, characterized in that, The information to be queried meeting the query conditions further includes: the polling times corresponding to the information to be queried are less than a preset number threshold; the polling times corresponding to the information to be queried are the number of times the third-party query device queries the trip information corresponding to the information to be queried; the initial value of the polling times corresponding to the information to be queried is 0. The method further includes: After obtaining the second trip information, the third-party query device performs at least one of the following: clearing the first duration to zero, and incrementing the polling times corresponding to the information to be queried by 1.
6. The method according to any one of claims 1-5, characterized in that The method further includes: The third-party query device traverses the preset keep-alive queue; When the third-party query device traverses the information to be queried in the preset keep-alive queue and the information to be queried meets the query condition, it determines whether the information to be queried meets the query condition.
7. The method according to any one of claims 1-6, characterized in that, The method further includes: When the terminal device determines that a second event has occurred, it sends a cancellation request to the third-party query device; the second event includes the terminal device leaving the target location range; the cancellation request includes the information to be queried; In response to the cancellation request, the third-party query device deletes the information to be queried from the preset keep-alive queue.
8. The method according to any one of claims 1-7, characterized in that When the terminal device determines that a first event has occurred, it sends a first query request to the third-party query device, including: When the terminal device determines that the first event has occurred, it sends a first query request to the third-party query device after a first delay duration.
9. The method according to any one of claims 1-7, characterized in that, The method further includes: The terminal device receives the first trip information, determines the trip information to be recommended from the first trip information, and displays a card including the trip information to be recommended.
10. A travel query method, characterized in that, Applied to a terminal device, the method includes: When the terminal device determines that a first event has occurred, it sends a first query request to a third-party query device; wherein, the first query request includes the information to be queried, and the first query request is used to request to query the trip information corresponding to the information to be queried; the first event includes at least one of the following: the terminal device enters the target location range, and the target travel application in the terminal device is closed; The terminal device receives the first trip information sent by the third-party query device.
11. The method according to claim 10, wherein The target location range includes: location information of the area where the target railway station is located; the target travel application includes: an application for managing train services, and an application for managing services of multiple transportation means.
12. The method according to claim 10 or 11, characterized in that, The method further includes: When the terminal device determines that a second event has occurred, it sends a cancellation request to the third-party query device; the second event includes the terminal device leaving the target location range; the cancellation request includes the information to be queried, and the cancellation request is used to request to end the query of the trip information corresponding to the information to be queried.
13. The method according to any one of claims 10 - 12, characterized in that, When the terminal device determines that a first event has occurred, it sends a first query request to a third-party query device, including: When the terminal device determines that the first event has occurred, it waits for a first delay duration and then sends a first query request to the third-party query device.
14. The method according to any one of claims 10 - 13, characterized in that, The method further includes: The terminal device receives the first trip information, determines the trip information to be recommended from the first trip information, and displays a card, and the card includes the trip information to be recommended.
15. A travel query system, characterized in that, The trip query system includes: a terminal device, a third-party query device, and an information management device; the terminal device, the third-party query device, and the information management device are used to execute the method according to any one of claims 1-9.
16. A terminal device, characterized in that, The terminal device includes: a processor, a memory, and a communication interface; the memory and the communication interface are coupled to the processor, the memory is used to store computer program code, and the computer program code includes computer instructions; wherein, when the processor executes the computer instructions, the terminal device is caused to execute the method described in any one of claims 10-14 above.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, and when the computer instructions run on the itinerary query system, the itinerary query system is caused to execute the method described in any one of claims 1-9; Alternatively, when the computer instructions run on the terminal device, the terminal device is caused to execute the method described in any one of claims 10-14.
Citation Information
Patent Citations
Travel prompt method and device
CN108600530A
Data query method, device, computer equipment and storage medium
CN110489447A
Request processing method, device and equipment
CN113010334A
Object guiding method, system and device, terminal and storage medium
CN114623843A
Travel information prompting method and electronic equipment
CN115689666A