Method, device, electronic device and storage medium for processing trip data

By generating node collections and creating virtual root node objects, the itinerary data is quickly assembled into a tree structure, solving the problem of high time complexity in the existing technology, improving processing efficiency and simplifying structure acquisition.

CN119739711APending Publication Date: 2025-04-01CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411666028.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the prior art, the method of assembling the trip data into a tree structure has high time complexity and low processing efficiency.

Method used

By generating a collection of nodes including multiple node objects, creating a virtual root node object, and saving its node objects corresponding to the trip elements to a hash table, quickly generating a tree structure corresponding to the trip data.

Benefits of technology

The time complexity of assembling the trip data into a tree structure is reduced, and the exponential order is reduced to a linear order, which improves the processing efficiency of the trip data and simplifies the acquisition of the tree structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739711A_ABST
    Figure CN119739711A_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and storage medium for processing travel data, and relates to the fields of data processing and computer technology. The method includes: based on the travel data to be processed, generating a node set including multiple node objects, the travel data includes travel elements under multiple travel dimensions with a preset hierarchical relationship, the travel elements under each travel dimension have an association relationship with at least one travel element under the adjacent hierarchical travel dimension, and each node object represents a travel element; saving a virtual root node object and multiple node objects to a hash table; obtaining the parent node object of each node object from the hash table, and adding each node object to the child node attribute of the parent node object to generate a tree structure corresponding to the travel data. The time complexity of assembling the travel data into a tree structure can be reduced, and the processing efficiency of the travel data can be improved, thereby improving the processing efficiency of the business in business scenarios such as travel approval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing and computer technology, and in particular to a method, device, electronic device and storage medium for processing travel data. Background Art

[0002] Trip data is a data record generated when a user or vehicle moves from one location to another within a period of time. In some business systems, trip data is a set of data that includes multiple trip elements. For example, from a geographical perspective, trip data includes trip element information in geographical dimensions such as continents, countries, regions, and cities; from a schedule perspective, trip data includes trip element information in time dimensions such as outbound and return trips; from an event perspective, trip data includes trip element information in event dimensions such as meetings and visits.

[0003] In many scenarios, it is necessary to display travel data. For example, in an enterprise, in order to standardize the employee travel process and control costs, it is necessary to approve the employee's travel itinerary, and during the approval process, the employee's travel data needs to be clearly displayed.

[0004] In order to make the itinerary data more intuitive, in business scenarios such as data display and itinerary approval, it can more clearly reflect the actual business scenarios corresponding to the itinerary data and improve the business processing efficiency, the itinerary data can be displayed in a tree structure. Related technologies generally use multi-layer loops and recursion to assemble itinerary data into a tree structure. This processing method has a high time complexity and low processing efficiency for itinerary data. Summary of the invention

[0005] The present application provides a method, device, electronic device and storage medium for processing travel data, so as to solve the technical problem that the travel data is assembled into a tree structure in the related art, which has high time complexity and low processing efficiency.

[0006] In a first aspect, the present application provides a method for processing travel data, the method comprising: generating a node set including a plurality of node objects based on the travel data to be processed, wherein the travel data comprises travel elements under a plurality of travel dimensions having a preset hierarchical relationship, the travel elements under each travel dimension have an association relationship with at least one travel element under an adjacent travel dimension, and each node object represents a travel element; creating a virtual root node object, and saving the root node object and the plurality of node objects to a hash table; obtaining a parent node object of each node object in the node set from the hash table, and adding each node object to a child node attribute of the parent node object, to generate a tree structure corresponding to the travel data; wherein the parent node object of a first node object in the node set is a target node object, the parent node object of a second node object in the node set is the root node object, the first node object represents a first travel element in a non-highest level travel dimension, the target node object represents a second travel element, the second travel element is in a travel dimension of a level above the non-highest level travel dimension, and has an association relationship with the first travel element, and the second node object represents a third travel element in a highest level travel dimension.

[0007] In a second aspect, the present application provides a device for processing travel data, the device comprising: a first generating module, for generating a node set including a plurality of node objects based on the travel data to be processed, wherein the travel data comprises travel elements under a plurality of travel dimensions having a preset hierarchical relationship, the travel elements under each travel dimension having an association relationship with at least one travel element under an adjacent hierarchical travel dimension, and each node object represents a travel element; a creating and storing module, for creating a virtual root node object, and saving the root node object and the plurality of node objects to a hash table; a processing module, for obtaining a parent node of each node object in the node set from the hash table; point object, and add each node object to the child node attribute of the parent node object to generate a tree structure corresponding to the travel data; wherein the parent node object of the first node object in the node set is the target node object, the parent node object of the second node object in the node set is the root node object, the first node object represents a first travel element in a non-highest level travel dimension, the target node object represents a second travel element, the second travel element is in a travel dimension of the previous level of the non-highest level travel dimension and has an association relationship with the first travel element, and the second node object represents a third travel element in the highest level travel dimension.

[0008] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect.

[0009] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.

[0010] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.

[0011] The technical solution provided in the embodiment of the present application generates a node set including multiple node objects based on the itinerary data to be processed, creates a virtual root node object, saves the root node object and the node objects corresponding to the itinerary elements to a hash table, obtains the parent node object of each node object in the node set from the hash table, and adds each node object to the child node attribute of its parent node object to generate a tree structure corresponding to the itinerary data. This can achieve fast storage and search characteristics based on the hash table, quickly save the virtual root node object and the node objects corresponding to the itinerary elements to the hash table, and quickly obtain the parent node object of each node object in the node set from the hash table to generate a tree structure, thereby reducing the time complexity of assembling the itinerary data into a tree structure from an exponential order to a linear order, thereby improving the processing efficiency of the itinerary data, and further improving the processing efficiency of the business in business scenarios such as itinerary approval. In addition, by creating a virtual root node object, when there are multiple itinerary elements under the highest-level itinerary dimension, the node objects corresponding to the multiple itinerary elements can be added to the child node attributes of the root node object. In this way, the generated tree structure can be easily obtained only through the root node object in the hash table, simplifying the method of obtaining the generated tree structure. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0013] Figure 1 The process of the method for processing the travel data provided in the embodiment of the present application Figure 1 ;

[0014] Figure 2 An example diagram of a tree structure provided in an embodiment of the present application;

[0015] Figure 3The process of the method for processing the travel data provided in the embodiment of the present application Figure 2 ;

[0016] Figure 4 An example diagram of the processing flow of travel data provided in an embodiment of the present application;

[0017] Figure 5 The process of the method for processing the travel data provided in the embodiment of the present application Figure 3 ;

[0018] Figure 6 An example diagram of the processing flow of travel data provided in an embodiment of the present application;

[0019] Figure 7 A schematic diagram of the structure of a device for processing travel data provided in an embodiment of the present application;

[0020] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0021] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0022] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0023] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties. The acquisition, transmission, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant laws and regulations of the relevant regions.

[0024] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0025] Related technologies generally use multi-layer loops and recursion to assemble the travel data into a tree structure. This processing method has high time complexity and low efficiency in processing the travel data.

[0026] In order to reduce the time complexity of assembling the trip data into a tree structure and improve the processing efficiency of the trip data, the embodiment of the present application proposes the following concepts:

[0027] Based on the travel data to be processed, a node set including multiple node objects is generated, wherein the travel data includes travel elements under multiple travel dimensions with a preset hierarchical relationship, the travel element under each travel dimension has an association relationship with at least one travel element under an adjacent level travel dimension, and each node object represents a travel element; a virtual root node object is created, and the root node object and the multiple node objects are saved in a hash table; the parent node object of each node object in the node set is obtained from the hash table, and each node object is added to the child node attribute of the parent node object to generate a tree structure corresponding to the travel data; wherein the parent node object of the first node object in the node set is the target node object, the parent node object of the second node object in the node set is the root node object, the first node object represents a first travel element in a non-highest level travel dimension, the target node object represents a second travel element, the second travel element is in a travel dimension of a level above the non-highest level travel dimension, and has an association relationship with the first travel element, and the second node object represents a third travel element in the highest level travel dimension.

[0028] Thus, based on the itinerary data to be processed, after generating a node set including multiple node objects, a virtual root node object is created, and the root node object and the node objects corresponding to the itinerary elements are saved to a hash table, and then the parent node object of each node object in the node set is obtained from the hash table, and each node object is added to the child node attribute of its parent node object to generate a tree structure corresponding to the itinerary data. The fast storage and search characteristics based on the hash table can be realized, and the virtual root node object and the node objects corresponding to the itinerary elements are quickly saved to the hash table, and the parent node object of each node object in the node set is quickly obtained from the hash table to generate a tree structure, so that the time complexity of assembling the itinerary data into a tree structure can be reduced from an exponential order to a linear order, and the processing efficiency of the itinerary data can be improved, and then the processing efficiency of the business can be improved in business scenarios such as itinerary approval. In addition, by creating a virtual root node object, when the number of itinerary elements under the highest level itinerary dimension is multiple, the node objects corresponding to the multiple itinerary elements can be added to the child node attribute of the root node object, so that the generated tree structure can be conveniently obtained only through the root node object in the hash table, simplifying the method of obtaining the generated tree structure.

[0029] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0030] First combine Figure 1 , the method for processing travel data provided in an embodiment of the present application is explained. Figure 1 The process of the method for processing the travel data provided in the embodiment of the present application Figure 1 .

[0031] It should be noted that the method for processing travel data provided in the embodiment of the present application can be executed by a travel data processing device, wherein the travel data processing device can be an electronic device or can be configured in an electronic device, and the present application does not limit this.

[0032] Among them, the electronic device can be any device with computing capabilities, such as a personal computer, a mobile terminal, a server, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0033] like Figure 1 As shown, the method for processing the travel data includes the following steps:

[0034] S101. Generate a node set including a plurality of node objects based on the travel data to be processed, wherein the travel data includes travel elements under a plurality of travel dimensions having a preset hierarchical relationship, the travel element under each travel dimension has an association relationship with at least one travel element under a travel dimension of an adjacent level, and each node object represents a travel element.

[0035] The travel data is a data record generated when a user or a vehicle moves from one location to another within a time period. In the embodiment of the present application, the travel data to be processed may include at least one data record of at least one user or vehicle. Each data record includes travel elements under multiple travel dimensions.

[0036] Trip dimensions describe different aspects or categories of trip data, and trip elements are specific data items or attributes under a specific trip dimension, providing more detailed description information. Each trip dimension can include one or more trip elements.

[0037] For example, multiple itinerary dimensions may include at least two of the intercontinental dimension, the national dimension, the city dimension, the time dimension, and the event dimension. Among them, the itinerary elements under the intercontinental dimension may include intercontinental 1, intercontinental 2, etc. The itinerary elements under the national dimension may include country 1, country 2, etc. The itinerary elements under the city dimension may include city 1, city 2, etc. The itinerary elements under the time dimension may include departure time 1, departure time 2, departure time 3, etc. The itinerary elements under the event dimension may include meetings, visits, etc.

[0038] In the embodiment of the present application, the preset hierarchical relationship between each itinerary dimension can be pre-set. For example, taking the itinerary dimension including the intercontinental dimension, the national dimension, the city dimension, the time dimension, and the event dimension as an example, it can be set that there is a hierarchical relationship between these itinerary dimensions, and the level of the intercontinental dimension is higher than the national dimension, the level of the national dimension is higher than the city dimension, the level of the city dimension is higher than the time dimension, and the level of the time dimension is higher than the event dimension, that is, the levels of the intercontinental dimension, the national dimension, the city dimension, the time dimension, and the event dimension decrease in sequence. In the itinerary data to be processed, the itinerary elements under each itinerary dimension have an association relationship with at least one itinerary element under the itinerary dimension of the adjacent level, so that according to the hierarchical relationship and the association relationship between the itinerary elements, a tree structure is generated, so that the nodes of each layer in the tree structure meet the hierarchical relationship, and the nodes of each layer are connected according to the association relationship between the corresponding itinerary elements.

[0039] For example, it is assumed that the itinerary data to be processed includes two data records of user 1 and two data records of user 2. The two data records of user 1 include: user 1 departed on September 1 to attend a meeting in city 1 of country 1 in continent 1, and departed on September 2 to travel in city 2 of country 1 in continent 1; the two data records of user 2 include: user 2 departed on September 6 to travel in city 3 of country 2 in continent 1, and departed on September 7 to visit city 3 of country 2 in continent 1.

[0040] That is, the itinerary data to be processed include: itinerary elements under the intercontinental dimension: intercontinental 1; itinerary elements under the country dimension: country 1 and country 2; itinerary elements under the city dimension: city 1, city 2 and city 3; itinerary elements under the time dimension: September 1, September 2, September 6 and September 7; itinerary elements under the event dimension: travel, conference and visit. Among them, country 1 under the country dimension is associated with intercontinental 1 under the intercontinental dimension and city 1 and city 2 under the city dimension. In addition, city 1 under the city dimension is also associated with September 1 under the time dimension, September 1 under the time dimension is also associated with the conference under the event dimension, city 2 under the city dimension is also associated with September 2 under the time dimension, and September 2 under the time dimension is also associated with travel under the event dimension. Country 2 under the national dimension is associated with Continent 1 under the continental dimension and City 3 under the city dimension. In addition, City 3 under the city dimension is also associated with September 6 and September 7 under the time dimension. September 6 under the time dimension is also associated with Travel under the event dimension. September 7 under the time dimension is also associated with Visit under the event dimension.

[0041] S102: Create a virtual root node object, and save the root node object and multiple node objects into a hash table.

[0042] In the embodiment of the present application, a virtual node object can be created and saved as a root node object in a hash table. In addition, the node set can be traversed and the traversed node objects can be saved in a hash table. After the traversal is completed, each node object in the node set is saved in the hash table.

[0043] S103, obtaining the parent node object of each node object in the node set from the hash table, and adding each node object to the child node attribute of the parent node object to generate a tree structure corresponding to the travel data.

[0044] It can be understood that in the embodiment of the present application, the travel element under the non-highest level travel dimension is called the first travel element, the node object representing the first travel element in the node set, that is, the node object corresponding to the first travel element, is called the first node object, and the parent node object of the first node object is the target node object in the node set, wherein the travel element represented by the target node object is called the second travel element, and the second travel element is in the previous level travel dimension of the non-highest level travel dimension where the first travel element is located, and has an association relationship with the first travel element. In addition, in the embodiment of the present application, the travel element under the highest level dimension is called the third travel element, and the node object representing the third travel element in the node set, that is, the node object corresponding to the third travel element, is called the second node object, wherein the parent node object of the second node object is the root node object.

[0045] That is, the parent node object of the first node object in the node set is the target node object, the parent node object of the second node object in the node set is the root node object, the first node object represents the first trip element in a non-highest level trip dimension, the target node object represents the second trip element, the second trip element is in the previous level trip dimension of the non-highest level trip dimension and has an association relationship with the first trip element, and the second node object represents the third trip element in the highest level trip dimension.

[0046] It should be noted that, for the first trip element in the next level of trip dimension of the highest level, the parent node object of the first node object representing the first trip element is a second node object, and for the first trip element in other levels of trip dimensions, the parent node object of the first node object representing the first trip element is a first node object. That is to say, for any first node object, the target node object as its parent node object may be a first node object or a second node object.

[0047] In an embodiment of the present application, a node set can be traversed, and for each traversed node object, the parent node object of the node object is obtained from the hash table, and the traversed node object is added to the child node attribute of its parent node object. After the traversal is completed, a tree structure corresponding to the travel data can be generated.

[0048] Continuing with the above example, taking the itinerary dimension including the continental dimension, the country dimension, the city dimension, the time dimension, and the event dimension, and the levels between them decreasing in sequence, the continental dimension is the highest level itinerary dimension, and the itinerary dimensions of other levels are non-highest level itinerary dimensions.

[0049] If the multi-layer loop and recursion in the related technology are used to assemble the travel data into a tree structure, the data traversal process at least includes: after creating the node objects corresponding to each travel element under the intercontinental dimension, that is, the node objects corresponding to the intercontinental dimension, creating the node objects corresponding to each travel element under the national dimension, that is, the node objects corresponding to the national dimension, and traversing each node object of the national dimension, for each traversed node object, traversing each node object of the intercontinental dimension to find the parent node object of the node corresponding to the national dimension; creating the node objects corresponding to each travel element under the city dimension, that is, the node objects corresponding to the city dimension, and traversing each node object of the city dimension, for each node object of the traversed city dimension, traversing each node object corresponding to the national dimension to find the parent node object of the node object of the city dimension. By analogy, that is, for each node object corresponding to each travel element under each non-highest level travel dimension, it is necessary to traverse the node objects corresponding to each travel element under the previous level travel dimension. It can be seen that the way of assembling the travel data into a tree structure has an exponential time complexity, a high time complexity, and low efficiency in processing travel data.

[0050] By adopting the method of the embodiment of the present application, for each node object in the node set, the parent node object of the node object can be directly obtained from the hash table, without traversing all the node objects and searching for the parent node object of the node object therefrom. Therefore, the method for processing travel data of the embodiment of the present application can reduce the time complexity of assembling travel data into a tree structure from exponential order to linear order, thereby improving the processing efficiency of travel data.

[0051] The tree structure corresponding to the trip data in the above example can be displayed as follows: Figure 2 As shown. Among them, the virtual root node object may not be displayed. Figure 2As shown, for the itinerary elements under the highest-level itinerary dimension, the node object corresponding to continent 1 has a root node object as its parent node object; for the itinerary elements under the non-highest-level itinerary dimension, the node object corresponding to country 1 and the node object corresponding to country 2 have both a node object corresponding to continent 1 as their parent node object, the node object corresponding to city 1 and the node object corresponding to city 2 have both a node object corresponding to country 1 as their parent node object, the node object corresponding to city 3 has a node object corresponding to country 2 as its parent node object, the node object corresponding to September 1 has a node object corresponding to city 1 as its parent node object, the node object corresponding to September 2 has a node object corresponding to city 2 as its parent node object, the node object corresponding to September 6 and the node object corresponding to September 7 have both a node object corresponding to city 3 as its parent node object, the node object corresponding to meeting has a node object corresponding to September 1 as its parent node object, the node object corresponding to travel has a node object corresponding to September 2 and a node object corresponding to September 6 as its parent node object, and the node object corresponding to visit has a node object corresponding to September 7 as its parent node object.

[0052] Thus, based on the itinerary data to be processed, after generating a node set including multiple node objects, a virtual root node object is created, and the root node object and the node objects corresponding to the itinerary elements are saved to a hash table, and then the parent node object of each node object in the node set is obtained from the hash table, and each node object is added to the child node attribute of its parent node object to generate a tree structure corresponding to the itinerary data. The fast storage and search characteristics based on the hash table can be realized, and the virtual root node object and the node objects corresponding to the itinerary elements are quickly saved to the hash table, and the parent node object of each node object in the node set is quickly obtained from the hash table to generate a tree structure, so that the time complexity of assembling the itinerary data into a tree structure can be reduced from an exponential order to a linear order, and the processing efficiency of the itinerary data can be improved, and then the processing efficiency of the business can be improved in business scenarios such as itinerary approval. In addition, by creating a virtual root node object, when the number of itinerary elements under the highest level itinerary dimension is multiple, the node objects corresponding to the multiple itinerary elements can be added to the child node attribute of the root node object, so that the generated tree structure can be conveniently obtained only through the root node object in the hash table, simplifying the method of obtaining the generated tree structure.

[0053] In addition, the trip dimension may include at least two of the continental dimension, national dimension, city dimension, time dimension, and event dimension, and the levels of these trip dimensions decrease successively, so that the tree structure generated based on the trip elements under these trip dimensions can clearly reflect the trip of the user or vehicle from multiple dimensions of continental, national, city, time, and event, thereby increasing the readability of the trip data.

[0054] Combine the following Figure 3 , in the method for processing travel data provided in an embodiment of the present application, the process of obtaining the parent node object of each node object from the hash table is further explained.

[0055] Figure 3 The process of the method for processing the travel data provided in the embodiment of the present application Figure 2 .like Figure 3 As shown, the method for processing the travel data includes the following steps:

[0056] S301. Generate a node set including a plurality of node objects based on the itinerary data to be processed, wherein the itinerary data includes itinerary elements under a plurality of itinerary dimensions having a preset hierarchical relationship, the itinerary element under each itinerary dimension has an association relationship with at least one itinerary element under an adjacent hierarchical itinerary dimension, and each node object represents a itinerary element.

[0057] The node set may include a first node object and a second node object, wherein the first node object is a node object representing a first trip element, and the first trip element is in a non-highest-level trip dimension; the second node object is a node object representing a third trip element, and the third trip element is in a highest-level trip dimension.

[0058] S302: Create a virtual root node object, use the node identifiers corresponding to the root node object and multiple node objects as keys of a hash table, and save the root node object and multiple node objects into the hash table.

[0059] The root node object and each node object in the node set have a corresponding node identifier, which is used to uniquely identify the corresponding node object or the root node object.

[0060] As an example, the node identifier of each node object in the node collection can be generated in the following way:

[0061] For each node object in the node set, obtain the identifier of the trip element corresponding to the node object;

[0062] Generate serial numbers and random numbers corresponding to node objects;

[0063] Generate a node ID for the node object based on the itinerary element ID, sequence number and random number.

[0064] Among them, the identifier of the trip element can be the identifier of the trip element when the trip data is collected, or it can be the identifier generated for the trip element by the trip data processing device, which is used to identify the corresponding trip element, and this application does not impose any restrictions on this.

[0065] The serial number corresponding to the node object is a unique identifier generated by the travel data processing device for the node object, which can uniquely distinguish different node objects.

[0066] A random number is a number generated by a travel data processing device within a specific range and has no obvious pattern.

[0067] In the embodiment of the present application, the identifier of the trip element, the serial number and the random number can be concatenated to generate the node identifier of the node object, thereby ensuring the uniqueness of the node identifier of each node object.

[0068] It should be noted that, as an example, the above process of generating a node identifier for each node object can be performed in the process of generating a node set based on the travel data to be processed, so that each node object in the generated node set has a corresponding node identifier.

[0069] In the embodiment of the present application, for any node object or root node object, the corresponding node identifier can be used as the key of the hash table, and the hash value corresponding to the node identifier can be determined through a hash function, and based on the hash value, the corresponding storage address in the hash table can be determined, and the node object corresponding to the node identifier can be saved to the storage address in the hash table. In this way, the root node object and multiple node objects can be quickly saved to the hash table.

[0070] S303: traverse the node set to obtain the parent node identifier of the currently traversed node object.

[0071] Each node object in the node set has a corresponding parent node identifier. As an example, the parent node identifier can be generated based on the association relationship between each travel element in the travel data and the node identifier of each node object when generating the node set based on the travel data to be processed.

[0072] It can be understood that since the node set includes the parent node object of the first node object, the parent node identifier of the first node object is the node identifier of its parent node object, and the node set does not include the parent node object of the second node object, the parent node identifier of the second node object can be a null value.

[0073] As an example, the parent node identifier of each node object in the node collection can be generated in the following way:

[0074] For each node object in the node set, determine the target trip dimension where the trip element corresponding to the node object is located;

[0075] In the case where the target trip dimension is not the highest-level trip dimension, determining the target trip element, wherein the target trip element is under the trip dimension of the upper level of the target trip dimension and has an association relationship with the trip element corresponding to the node object, and using the node identifier of the node object corresponding to the target trip element as the parent node identifier of the node object;

[0076] When the target trip dimension is the highest-level trip dimension, a null value is used as the parent node identifier of the node object.

[0077] It can be understood that, for each node object in the node set, after determining the target trip dimension where the trip element corresponding to the node object is located, if the target trip dimension is not the highest-level trip dimension, the node object is the first node object, and its parent node object is a node object in the node set. Then, the node identifier of the node object corresponding to the target trip element can be used as the parent node identifier of the node object, wherein the target trip element is under the trip dimension of the upper level of the target trip dimension and has an association relationship with the trip element corresponding to the node object; if the target trip dimension is the highest-level trip dimension, the node object is the second node object, and its parent node object is not in the node set. A null value can be used as the parent node identifier of the node object.

[0078] For example, continuing the above example, assume that the itinerary data to be processed includes two data records of user 1 and two data records of user 2. The two data records of user 1 include: user 1 departed on September 1 to attend a meeting in city 1 of country 1 in continental 1, and departed on September 2 to travel in city 2 of country 1 in continental 1; the two data records of user 2 include: user 2 departed on September 6 to travel in city 3 of country 2 in continental 1, and departed on September 7 to visit city 3 of country 2 in continental 1.

[0079] Among them, it is assumed that the identifier of the node object corresponding to the itinerary element Intercontinental 1 is "Node1". Taking the node object corresponding to the itinerary element Intercontinental 1 as an example, since the target itinerary dimension where Intercontinental 1 is located is the highest-level dimension, the null value can be used as the parent node identifier of the node object corresponding to Intercontinental 1. Taking the node object corresponding to the itinerary element Country 1 as an example, since the target itinerary dimension where Country 1 is located is not the highest-level itinerary dimension, and the itinerary element associated with Country 1 under the upper-level itinerary dimension of the target itinerary dimension is Intercontinental 1, the node identifier "Node1" of the node object corresponding to Intercontinental 1 can be used as the parent node identifier of the node object corresponding to Country 1.

[0080] Thus, a unique parent node identifier can be generated for each node object in the node set, laying a foundation for quickly obtaining the parent node object of each node object from the hash table based on the parent node identifier.

[0081] It should be noted that, as an example, the above process of generating the parent node identifier of each node object can be executed in the process of generating a node set based on the travel data to be processed, so that each node object in the generated node set has a corresponding parent node identifier, and the parent node identifier of the currently traversed node object can be obtained by traversing the node set.

[0082] S304: When the obtained parent node identifier is not a null value, the parent node identifier is used as a key of a hash table, the corresponding parent node object is obtained from the hash table, and the currently traversed node object is added to the child node attribute of the parent node object.

[0083] It can be understood that, when the parent node identifier of the currently traversed node object is not a null value, the currently traversed node object is the first node object corresponding to the first trip element, and the parent node object of the first node object is a node object in the node set. When each node object in the node set is stored in a hash table, the node identifier of each node object is used as the key of the hash table for storage. Then, the parent node identifier of the currently traversed node object can be used as the key of the hash table to obtain the corresponding parent node object from the hash table, and the currently traversed node object can be added to the child node attribute of its parent node object.

[0084] As an example, in S304, using the parent node identifier as a key of a hash table and obtaining the corresponding parent node object from the hash table may include:

[0085] Determine the hash value corresponding to the parent node identifier through a hash function;

[0086] Based on the hash value, obtain the storage address of the parent node object corresponding to the parent node identifier in the hash table;

[0087] Based on the storage address, get the corresponding parent node object from the hash table.

[0088] Therefore, the parent node object of the node object currently traversed can be directly and quickly obtained from the hash table only through the parent node identifier of the node object, thereby improving the efficiency of obtaining the parent node object of the node object.

[0089] S305. When the obtained parent node identifier is a null value, the obtained parent node identifier is assigned to the identifier of the root node object, and the parent node identifier is used as the key of the hash table to obtain the corresponding parent node object from the hash table, and the currently traversed node object is added to the child node attribute of the parent node object.

[0090] It can be understood that, when the parent node identifier of the node object currently traversed is a null value, the node object currently traversed is the second node object corresponding to the third trip element, and the parent node object of the second node object is the root node object. When the root node object is stored in a hash table, the node identifier of the root node object is used as the key of the hash table for storage. Then, the parent node identifier of the node object currently traversed can be assigned to the identifier of the root node object, and the assigned parent node identifier is used as the key of the hash table to obtain the corresponding parent node object from the hash table, and the node object currently traversed is added to the child node attribute of its parent node object (i.e., the root node object).

[0091] As an example, in S305, using the parent node identifier as a key of a hash table and obtaining the corresponding parent node object from the hash table may include:

[0092] Determine the hash value corresponding to the parent node identifier through a hash function;

[0093] Obtain the storage address of the parent node object corresponding to the parent node identifier based on the hash value;

[0094] Based on the storage address, get the corresponding parent node object from the hash table.

[0095] Therefore, the parent node object of the node object currently traversed can be directly and quickly obtained from the hash table only through the parent node identifier of the node object, thereby improving the efficiency of obtaining the parent node object of the node object.

[0096] S306: After the node set traversal is completed, a tree structure corresponding to the travel data is generated.

[0097] After the node set traversal is completed, each node object in the node set is added to the child node attribute of its parent node object, thereby completing the assembly of the nodes in the tree structure and generating a tree structure corresponding to the travel data.

[0098] refer to Figure 4 After generating a node set including multiple node objects based on the itinerary data to be processed, the itinerary data processing device can use the node identifiers corresponding to the multiple node objects as the keys of the hash table and save the multiple node objects into the hash table (corresponding to Figure 4 In step S401), a virtual root node object can be created, and the node identifier of the root node object is used as the key of the hash table to save the root node object to the hash table (corresponding to Figure 4 Further, the travel data processing device can traverse the node set to obtain the parent node identifier of the currently traversed node object (corresponding to Figure 4Step S403 in the above example), and then, if the obtained parent node identifier is not a null value, the parent node identifier is used as the key of the hash table, the corresponding parent node object is obtained from the hash table, and the currently traversed node object is added to the child node attribute of the parent node object. If the obtained parent node identifier is a null value, the obtained parent node identifier is assigned to the identifier of the root node object, and the parent node identifier is used as the key of the hash table, the corresponding parent node object is obtained from the hash table, and the currently traversed node object is added to the child node attribute of the parent node object (corresponding Figure 4 In step S404), after the node set traversal is completed, a tree structure corresponding to the travel data is generated.

[0099] The method for processing travel data provided by the embodiment of the present application generates a node set including multiple node objects based on the travel data to be processed, creates a virtual root node object, and uses the node identifiers corresponding to the root node object and the multiple node objects as the keys of the hash table, saves the root node object and the multiple node objects to the hash table, and then traverses the node set to obtain the parent node identifier of the currently traversed node object. When the obtained parent node identifier is not a null value, the parent node identifier is used as the key of the hash table to obtain the corresponding parent node object from the hash table, and adds the currently traversed node object to the child node attribute of the parent node object. When the obtained parent node identifier is a null value, the obtained parent node identifier is assigned to the identifier of the root node object, and the parent node identifier is used as the key of the hash table. The corresponding parent node object is obtained from the list, and the currently traversed node object is added to the child node attribute of the parent node object. After the node set traversal is completed, the tree structure corresponding to the itinerary data is generated, which can realize the fast storage and search characteristics based on the hash table. Through the node identifiers of the root node object and the node object corresponding to the itinerary element, the root node object and the node object corresponding to the itinerary element are directly and quickly saved to the hash table, and through the parent node identifier of each node object in the node set, the parent node object of each node object is directly and quickly obtained from the hash table to generate a tree structure, so that the time complexity of assembling the itinerary data into a tree structure can be reduced from the exponential order to the linear order, improving the processing efficiency of the itinerary data, and then improving the processing efficiency of the business in business scenarios such as itinerary approval. In addition, by creating a virtual root node object, when the number of itinerary elements under the highest level itinerary dimension is multiple, the node objects corresponding to the multiple itinerary elements can be added to the child node attribute of the root node object, so that the generated tree structure can be conveniently obtained only through the root node object in the hash table, simplifying the method of obtaining the generated tree structure.

[0100] In one possible implementation, the trip data may include multiple categories of sub-trip data, each category of sub-trip data includes at least one trip element under a trip dimension; different categories of sub-trip data meet at least one of the following conditions: collected based on different collection methods, stored in different locations, with different query methods, different data formats, and different data structures. In the embodiment of the present application, for multiple categories of sub-trip data, a unified node set can be generated so that each node object in the node set has a corresponding node identifier, parent node identifier, and child node attributes. Figure 5 , the method for processing travel data provided in the embodiment of the present application is further explained.

[0101] Figure 5 The process of the method for processing the travel data provided in the embodiment of the present application Figure 3 .like Figure 5 As shown, the method for processing the travel data includes the following steps:

[0102] S501, obtaining travel data to be processed.

[0103] The trip data includes multiple types of sub-trip data, each type of sub-trip data includes at least one trip element under a trip dimension, and different types of sub-trip data meet at least one of the following conditions: collected based on different collection methods, stored in different locations, with different query methods, different data formats, and different data structures. Multiple trip dimensions have a preset hierarchical relationship, and the trip elements under each trip dimension are associated with at least one trip element under the trip dimension of the adjacent level.

[0104] Among them, different collection methods may include real-time collection, collection at a preset frequency, etc. Different storage locations may include hard disk, cloud storage, etc. Different query methods may include different interfaces or different query languages ​​for querying. Different data formats may include image format, text format, table format, JSON format, XML format, etc. Different data structures may include structured data in table form, unstructured data in text or image form, etc.

[0105] For example, refer to Figure 6, taking the example that multiple itinerary dimensions include continental dimension, country dimension, city dimension, time dimension, event dimension, and the levels of continental dimension, country dimension, city dimension, time dimension, and event dimension are successively reduced. Then three types of sub-trip data can be collected from the data source, wherein the data formats of the three types of sub-trip data are different. Among them, sub-trip data 1 includes itinerary elements under the itinerary dimensions of continental dimension, country dimension, and city dimension in the form of a table, such as each row of data in the table includes 3 columns, namely city, continent, and country. The city, continent, and country in the same row indicate that the city in the row belongs to the country and continent in the row, and the country in the row belongs to the continent in the row; sub-trip data 2 includes itinerary elements under the city dimension and time dimension in the form of text, such as a user described in text going to a city at a certain time; sub-trip data 3 includes itinerary elements under the time dimension and event dimension in the form of text, such as a user described in text going to a city to do something in a certain city.

[0106] S502. Encapsulate each type of sub-trip data in a corresponding data object to obtain multiple data objects, wherein each data object includes a specific implementation of a predefined method in a predefined abstract interface, and the predefined method includes a method for obtaining a node identifier, a parent node identifier, and child node attributes of each node object, and each node object represents a trip element.

[0107] In an embodiment of the present application, an abstract interface may be predefined to unify data objects, which includes predefined methods but does not include specific implementations of the predefined methods. Among them, the predefined methods include a method for obtaining the node identifier of each node object, a method for obtaining the parent node identifier of each node object, and a method for obtaining the child node attributes of each node object. In addition, data objects corresponding to each type of sub-trip data may be predefined, and these data objects all follow the predefined abstract interface, which includes specific implementations of the predefined methods in the abstract interface. After obtaining multiple types of sub-trip data, each type of sub-trip data may be encapsulated in a corresponding data object to obtain multiple data objects, thereby uniformly implementing the abstract interface through all data objects.

[0108] For example, continue to refer to Figure 6 , the three types of sub-trip data can be encapsulated in corresponding data objects respectively to obtain three data objects.

[0109] The specific implementation of the predefined method included in each data object can be set according to the data characteristics of the corresponding sub-trip data, so as to implement the predefined method according to its own data characteristics.

[0110] For example, assuming that for the sub-trip data 1 in the above example, its data format is in table form, and each row of data in the table includes 3 columns, namely city, continent, and country. The city, continent and country in the same row indicate that the city in the row belongs to the country and continent in the row, and the country in the row belongs to the continent in the row, and it includes the Chinese name of each trip element and a unique label.

[0111] The specific implementation of the method for obtaining the node identification of each node object may be set based on the following logic, for example: for each node object, the node identification of the node object is generated based on the unique number, serial number and random number of the corresponding itinerary element.

[0112] The specific implementation of the method for obtaining the parent node identifier of each node object can be set based on the following logic, for example: for the node object corresponding to each city under the city dimension, determine the itinerary element (specifically a country) in the same row as the city under the previous itinerary dimension, i.e., the country dimension, and use the node identifier of the node object corresponding to the itinerary element as the parent node identifier of the node object corresponding to the city; for the node object corresponding to each country under the country dimension, determine the itinerary element (specifically a continent) in the same row as the country under the previous itinerary dimension, i.e., the continental dimension, and use the node identifier of the node object corresponding to the itinerary element as the parent node identifier of the node object corresponding to the country; for the node object corresponding to each continent under the continental dimension, use a null value as its parent node identifier.

[0113] The specific implementation of the method for obtaining the child node attributes of each node object can be based on the method for obtaining node attributes in the related art, which will not be repeated here.

[0114] S503: Based on the predefined method and the specific implementations in the multiple data objects, a node set including multiple node objects is generated, and each of the node objects has a corresponding node identifier, a parent node identifier, and a child node attribute.

[0115] It is understandable that each data object includes a specific implementation of the predefined method, and based on these data objects that implement the abstract interface, a node set including multiple node objects can be generated. Each node object in the node set represents a trip element, and each node object has the node identifier, parent node identifier and child node attributes defined in the abstract interface.

[0116] For example, continue to refer to Figure 6 , a node set including multiple node objects can be generated based on the predefined method and the specific implementation in the three data objects.

[0117] By encapsulating the sub-trip data of the corresponding class in each data object, the data objects corresponding to multiple types of sub-trip data uniformly implement the predefined abstract interface, so that a unified node set can be generated based on sub-trip data of different classes, so that each node object has the node identifier, parent node identifier and child node attributes defined in the abstract interface.

[0118] The parent node identifier of the first node object is the node identifier of its parent node object, and the parent node identifier of the second node object is a null value.

[0119] It should be noted that, when there are duplicate node objects in the generated node set, a preset deduplication method can also be used to achieve node deduplication.

[0120] S504: traverse the node set, use the node identifiers of the multiple node objects as keys of the hash table, and save the multiple node objects into the hash table.

[0121] S505: Create a virtual root node object, use the node identifier of the root node object as the key of the hash table, and save the root node object to the hash table.

[0122] S506: traverse the node set to obtain the parent node identifier of the currently traversed node object.

[0123] S507: When the obtained parent node identifier is not a null value, the parent node identifier is used as a key of a hash table, the corresponding parent node object is obtained from the hash table, and the currently traversed node object is added to the child node attribute of the parent node object.

[0124] S508. When the obtained parent node identifier is a null value, the obtained parent node identifier is assigned to the identifier of the root node object, and the parent node identifier is used as the key of the hash table to obtain the corresponding parent node object from the hash table, and the currently traversed node object is added to the child node attribute of the parent node object.

[0125] It should be noted that, as an example, the arrangement order of the child node objects of any node object in the tree structure can also be preset. For example, for the node objects corresponding to the itinerary elements of the time dimension, the arrangement order can be arranged in order from early to late, so that when the currently traversed node object is added to the child node attribute of the parent node object, it can be added according to the preset arrangement order, so that the tree structure can more clearly reflect the itinerary data.

[0126] S509: After the node set traversal is completed, a tree structure corresponding to the travel data is generated.

[0127] Among them, the parent node object of the first node object in the node set is the target node object, the parent node object of the second node object in the node set is the root node object, the first node object represents the first trip element in a non-highest level trip dimension, the target node object represents the second trip element, the second trip element is in the previous level trip dimension of the non-highest level trip dimension, and has an association relationship with the first trip element, and the second node object represents the third trip element in the highest level trip dimension.

[0128] In this way, fast storage and search characteristics based on hash tables can be realized. Through the node identifiers of the root node object and the node objects corresponding to the itinerary elements, the root node object and the node objects corresponding to the itinerary elements can be directly and quickly saved to the hash table, and through the parent node identifier of each node object in the node set, the parent node object of each node object can be directly and quickly obtained from the hash table to generate a tree structure. As a result, the time complexity of assembling the itinerary data into a tree structure can be reduced from the exponential order to the linear order, thereby improving the processing efficiency of the itinerary data, and further improving the processing efficiency of the business in business scenarios such as itinerary approval.

[0129] Furthermore, after the tree structure corresponding to the travel data is generated, the following steps may also be included:

[0130] Get the root node object from the hash table;

[0131] Based on the obtained root node object, a tree structure is obtained;

[0132] Displays the tree structure.

[0133] For example, continue to refer to Figure 6 , according to the steps shown in S504-509, based on the node set, a hash table storing the root node object and the node objects in the node set can be generated, and each node object has been added to the child node attribute of its parent node, thereby generating a tree structure. Further, the root node object can be obtained from the hash table, and the tree structure can be obtained based on the obtained root node object, and then the tree structure can be displayed.

[0134] As an example, the hash value corresponding to the node identifier of the root node object can be determined through a hash function, and the storage address of the root node object in the hash table can be obtained based on the hash value. Based on the storage address, the root node object can be obtained from the hash table. Since the second node object is added to the child node attribute of the root node object, the first node object corresponding to the itinerary element under the next level of itinerary dimension is added to the child node attribute of each second node object, and the first node object corresponding to the itinerary element under the next level of itinerary dimension is added to the child node attribute of each first node object, the generated tree structure can be easily obtained and displayed only through the root node object, which simplifies the method of obtaining the generated tree structure. In addition, by displaying itinerary data in a tree structure, it can reflect itinerary data more intuitively and accurately, improve business processing efficiency in business scenarios such as itinerary approval, and reduce the number of interactions when users query itinerary data, thereby improving user experience.

[0135] Figure 7 A schematic diagram of the structure of a travel data processing device provided in an embodiment of the present application.

[0136] like Figure 7 As shown, the travel data processing device 700 includes: a first generating module 710 , a creating and storing module 720 , and a processing module 730 .

[0137] The first generating module 710 is used to generate a node set including a plurality of node objects based on the itinerary data to be processed, wherein the itinerary data includes itinerary elements under a plurality of itinerary dimensions having a preset hierarchical relationship, and the itinerary elements under each itinerary dimension have an association relationship with at least one itinerary element under an adjacent hierarchical itinerary dimension, and each node object represents a itinerary element;

[0138] A creation and storage module 720, used to create a virtual root node object, and save the root node object and multiple node objects into a hash table;

[0139] The processing module 730 is used to obtain the parent node object of each node object in the node set from the hash table, and add each node object to the child node attribute of the parent node object to generate a tree structure corresponding to the travel data;

[0140] Among them, the parent node object of the first node object in the node set is the target node object, the parent node object of the second node object in the node set is the root node object, the first node object represents the first trip element in a non-highest level trip dimension, the target node object represents the second trip element, the second trip element is in the previous level trip dimension of the non-highest level trip dimension, and has an association relationship with the first trip element, and the second node object represents the third trip element in the highest level trip dimension.

[0141] It should be noted that the travel data processing device 700 provided in the embodiment of the present application can execute the travel data processing method in the above embodiment. The travel data processing device can be an electronic device or can be configured in an electronic device.

[0142] Among them, the electronic device can be any device with computing capabilities, such as a personal computer, a mobile terminal, a server, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0143] In some embodiments, the root node object has a corresponding node identifier, and each node object has a corresponding node identifier and a parent node identifier, wherein the parent node identifier of the first node object is the node identifier of its parent node object, and the parent node identifier of the second node object is a null value; when the root node object and multiple node objects are saved to a hash table, the corresponding node identifier is used as the key of the hash table;

[0144] The processing module 730 includes an acquisition unit, which is used to:

[0145] Traverse the node collection and obtain the parent node ID of the currently traversed node object;

[0146] When the obtained parent node identifier is not a null value, the parent node identifier is used as the key of the hash table to obtain the corresponding parent node object from the hash table;

[0147] When the obtained parent node identifier is a null value, the obtained parent node identifier is assigned as the identifier of the root node object, and the parent node identifier is used as the key of the hash table to obtain the corresponding parent node object from the hash table.

[0148] In some embodiments, the acquisition unit is configured to:

[0149] Determine the hash value corresponding to the parent node identifier through a hash function;

[0150] Based on the hash value, obtain the storage address of the parent node object corresponding to the parent node identifier in the hash table;

[0151] Based on the storage address, get the corresponding parent node object from the hash table.

[0152] In some embodiments, the travel data processing device 700 further includes:

[0153] A first acquisition module is used to acquire, for each node object in the node set, an identifier of a trip element corresponding to the node object;

[0154] The second generation module is used to generate a serial number and a random number corresponding to the node object;

[0155] The third generating module is used to generate a node identifier of the node object based on the identifier of the trip element, the serial number and the random number.

[0156] In some embodiments, the travel data processing device 700 further includes:

[0157] A first determination module is used to determine, for each node object in the node set, a target trip dimension where a trip element corresponding to the node object is located;

[0158] A second determination module is used to determine a target trip element when the target trip dimension is not a highest-level trip dimension, wherein the target trip element is in a trip dimension of a level above the target trip dimension and has an association relationship with the trip element corresponding to the node object, and uses a node identifier of the node object corresponding to the target trip element as a parent node identifier of the node object;

[0159] The third determination module is configured to use a null value as a parent node identifier of the node object when the target trip dimension is a highest-level trip dimension.

[0160] In some embodiments, the trip data includes multiple types of sub-trip data, wherein each type of sub-trip data includes at least one trip element under a trip dimension; different types of sub-trip data meet at least one of the following conditions: collected based on different collection methods, stored in different locations, queried in different ways, in different data formats, and in different data structures;

[0161] The first generating module 710 is used to:

[0162] Encapsulating each type of sub-trip data in a corresponding data object to obtain multiple data objects, wherein each data object includes a specific implementation of a predefined method in a predefined abstract interface, and the predefined method includes a method for obtaining a node identifier, a parent node identifier, and a child node attribute of each node object;

[0163] Based on the predefined method and the specific implementation in the multiple data objects, a node set including multiple node objects is generated, and each of the node objects has a corresponding node identifier, a parent node identifier and a child node attribute.

[0164] In some embodiments, the travel data processing device 700 further includes:

[0165] The second acquisition module is used to obtain the root node object from the hash table;

[0166] A third acquisition module is used to obtain a tree structure based on the acquired root node object;

[0167] Display module, used to display tree structure.

[0168] In some embodiments, the multiple travel dimensions include at least two of the continental dimension, the national dimension, the city dimension, the time dimension, and the event dimension, and the levels of the continental dimension, the national dimension, the city dimension, the time dimension, and the event dimension decrease in sequence.

[0169] The travel data processing device provided in the embodiment of the present application can be used to execute the technical solution of the travel data processing method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0170] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the processing module 730 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above processing module 730. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0171] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device may include: a transceiver 121 , a processor 122 , and a memory 123 .

[0172] The processor 122 executes the computer execution instructions stored in the memory, so that the processor 122 executes the scheme in the above embodiment. The processor 122 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0173] The memory 123 is connected to the processor 122 via a system bus and completes communication between them. The memory 123 is used to store computer program instructions.

[0174] The transceiver 121 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.

[0175] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.

[0176] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the method for processing travel data in the above embodiment.

[0177] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the method for processing travel data in the above embodiment.

[0178] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the method for processing travel data in the above embodiment.

[0179] The electronic device, chip, computer-readable storage medium, and computer program product provided in the embodiments of the present application can be used to execute the technical solutions of the method for processing travel data in the above embodiments. The implementation principles and technical effects are similar and will not be repeated here.

[0180] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0181] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for processing travel data, characterized in that: The method comprises: Generate a node set including a plurality of node objects based on the itinerary data to be processed, wherein the itinerary data includes itinerary elements under a plurality of itinerary dimensions having a preset hierarchical relationship, the itinerary element under each itinerary dimension has an association relationship with at least one itinerary element under an adjacent hierarchical itinerary dimension, and each node object represents a itinerary element; Creating a virtual root node object, and saving the root node object and the multiple node objects into a hash table; Obtaining the parent node object of each node object in the node set from the hash table, and adding each node object to the child node attribute of the parent node object, to generate a tree structure corresponding to the trip data; The parent node object of the first node object in the node set is the target node object, the parent node object of the second node object in the node set is the root node object, the first node object represents a first trip element in a non-highest-level trip dimension, the target node object represents a second trip element, the second trip element is in a trip dimension of the previous level of the non-highest-level trip dimension and has an association relationship with the first trip element, and the second node object represents a third trip element in the highest-level trip dimension.

2. The method according to claim 1, characterized in that The root node object has a corresponding node identifier, and each of the node objects has a corresponding node identifier and a parent node identifier, wherein the parent node identifier of the first node object is the node identifier of its parent node object, and the parent node identifier of the second node object is a null value; when the root node object and the multiple node objects are saved in the hash table, the corresponding node identifier is used as the key of the hash table; The obtaining the parent node object of each node object in the node set from the hash table includes: Traverse the node set to obtain the parent node identifier of the currently traversed node object; When the obtained parent node identifier is not a null value, the parent node identifier is used as a key of the hash table, and a corresponding parent node object is obtained from the hash table; When the obtained parent node identifier is a null value, the obtained parent node identifier is assigned as the identifier of the root node object, and the parent node identifier is used as the key of the hash table to obtain the corresponding parent node object from the hash table.

3. The method according to claim 2, characterized in that The step of using the parent node identifier as a key of the hash table and obtaining a corresponding parent node object from the hash table includes: Determine the hash value corresponding to the parent node identifier through a hash function; Based on the hash value, obtain the storage address of the parent node object corresponding to the parent node identifier in the hash table; Based on the storage address, the corresponding parent node object is obtained from the hash table.

4. The method according to claim 2, characterized in that: The method further comprises: For each node object in the node set, obtaining an identifier of a trip element corresponding to the node object; Generate a serial number and a random number corresponding to the node object; A node identifier of the node object is generated based on the identifier of the trip element, the sequence number and the random number.

5. The method according to claim 2, characterized in that: The method further comprises: For each node object in the node set, determining a target trip dimension where a trip element corresponding to the node object is located; In the case where the target trip dimension is the non-highest-level trip dimension, determining a target trip element, wherein the target trip element is under the trip dimension of the upper level of the target trip dimension and has an association relationship with the trip element corresponding to the node object, and using the node identifier of the node object corresponding to the target trip element as the parent node identifier of the node object; When the target trip dimension is the highest-level trip dimension, the null value is used as the parent node identifier of the node object.

6. The method according to any one of claims 2 to 5, characterized in that: The trip data includes multiple types of sub-trip data, wherein each type of sub-trip data includes at least one trip element under a trip dimension; different types of sub-trip data meet at least one of the following conditions: collected based on different collection methods, stored in different locations, with different query methods, different data formats, and different data structures; The generating a node set including a plurality of node objects based on the travel data to be processed includes: Encapsulating each type of sub-trip data in a corresponding data object to obtain a plurality of data objects, wherein each of the data objects includes a specific implementation of a predefined method in a predefined abstract interface, and the predefined method includes a method for obtaining a node identifier, a parent node identifier, and child node attributes of each node object; Based on the predefined method and the specific implementations in the multiple data objects, a node set including the multiple node objects is generated, and each of the node objects has a corresponding node identifier, a parent node identifier and a child node attribute.

7. The method according to any one of claims 1 to 5, characterized in that After generating the tree structure corresponding to the travel data, the method further includes: Get the root node object from the hash table; Based on the acquired root node object, obtain the tree structure; The tree structure is displayed.

8. The method according to any one of claims 1 to 5, characterized in that The multiple travel dimensions include at least two of an intercontinental dimension, a national dimension, a city dimension, a time dimension, and an event dimension, and the levels of the intercontinental dimension, the national dimension, the city dimension, the time dimension, and the event dimension decrease in sequence.

9. A device for processing travel data, characterized in that: The device comprises: A first generating module is used to generate a node set including a plurality of node objects based on the itinerary data to be processed, wherein the itinerary data includes itinerary elements under a plurality of itinerary dimensions having a preset hierarchical relationship, the itinerary element under each itinerary dimension has an association relationship with at least one itinerary element under an adjacent hierarchical itinerary dimension, and each node object represents a itinerary element; A creation and storage module, used for creating a virtual root node object, and saving the root node object and the plurality of node objects into a hash table; A processing module, used for obtaining the parent node object of each node object in the node set from the hash table, and adding each node object to the child node attribute of the parent node object to generate a tree structure corresponding to the travel data; The parent node object of the first node object in the node set is the target node object, the parent node object of the second node object in the node set is the root node object, the first node object represents a first trip element in a non-highest-level trip dimension, the target node object represents a second trip element, the second trip element is in a trip dimension of the previous level of the non-highest-level trip dimension and has an association relationship with the first trip element, and the second node object represents a third trip element in the highest-level trip dimension.

10. The device according to claim 9, characterized in that The root node object has a corresponding node identifier, and each of the node objects has a corresponding node identifier and a parent node identifier, wherein the parent node identifier of the first node object is the node identifier of its parent node object, and the parent node identifier of the second node object is a null value; when the root node object and the multiple node objects are saved in the hash table, the corresponding node identifier is used as the key of the hash table; The processing module includes an acquisition unit, which is used to: Traverse the node set to obtain the parent node identifier of the currently traversed node object; When the obtained parent node identifier is not a null value, the parent node identifier is used as a key of the hash table, and a corresponding parent node object is obtained from the hash table; When the obtained parent node identifier is a null value, the obtained parent node identifier is assigned as the identifier of the root node object, and the parent node identifier is used as the key of the hash table to obtain the corresponding parent node object from the hash table.

11. The device according to claim 10, characterized in that The acquisition unit is used to: Determine the hash value corresponding to the parent node identifier through a hash function; Based on the hash value, obtain the storage address of the parent node object corresponding to the parent node identifier in the hash table; Based on the storage address, the corresponding parent node object is obtained from the hash table.

12. The device according to claim 10, characterized in that The device also includes: A first acquisition module, configured to acquire, for each node object in the node set, an identifier of a trip element corresponding to the node object; A second generating module, used to generate a serial number and a random number corresponding to the node object; The third generating module is used to generate a node identifier of the node object based on the identifier of the trip element, the serial number and the random number.

13. The device according to claim 10, characterized in that The device also includes: A first determination module is used to determine, for each node object in the node set, a target trip dimension where a trip element corresponding to the node object is located; a second determining module, configured to determine a target trip element when the target trip dimension is the non-highest-level trip dimension, wherein the target trip element is in a trip dimension of a level above the target trip dimension and has an association relationship with the trip element corresponding to the node object, and use a node identifier of the node object corresponding to the target trip element as a parent node identifier of the node object; The third determining module is configured to use the null value as a parent node identifier of the node object when the target trip dimension is the highest-level trip dimension.

14. The device according to any one of claims 10 to 13, characterized in that The trip data includes multiple types of sub-trip data, wherein each type of sub-trip data includes at least one trip element under a trip dimension; different types of sub-trip data meet at least one of the following conditions: collected based on different collection methods, stored in different locations, with different query methods, different data formats, and different data structures; The first generating module is used for: Encapsulating each type of sub-trip data in a corresponding data object to obtain a plurality of data objects, wherein each of the data objects includes a specific implementation of a predefined method in a predefined abstract interface, and the predefined method includes a method for obtaining a node identifier, a parent node identifier, and child node attributes of each node object; Based on the predefined method and the specific implementations in the multiple data objects, a node set including the multiple node objects is generated, and each of the node objects has a corresponding node identifier, a parent node identifier and a child node attribute.

15. The device according to any one of claims 9 to 13, characterized in that The device also includes: A second acquisition module, used for acquiring the root node object from the hash table; A third acquisition module, used to obtain the tree structure based on the acquired root node object; The display module is used to display the tree structure.

16. The device according to any one of claims 9 to 13, characterized in that The multiple travel dimensions include at least two of an intercontinental dimension, a national dimension, a city dimension, a time dimension, and an event dimension, and the levels of the intercontinental dimension, the national dimension, the city dimension, the time dimension, and the event dimension decrease in sequence.

17. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.

19. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.