Civil aviation freight rate multi-data-source interaction device, method, equipment and medium

By introducing the data interactifier factory manager and data interactifier factory in the civil aviation freight system, using generalized data interactive interface and multiple inheritance technology, dynamically constructing data source business data interactors, solving the data interactive design in the civil aviation freight rate system The impact on performance and scalability has achieved high -efficiency, maintenance and scalability interaction.

CN119376981APending Publication Date: 2025-01-28TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411517683.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

Under the high-performance demand of civil aviation freight system, data interaction design has a direct impact on system performance and scalability. The existing technology lacks a suitable data interaction framework, especially in the C++ technology stack.

Method used

Provide a civil aviation freight multi -data interaction device. Through the data interactifier factory manager and data interactor factory, use generalized data interactive interface and multiple inheritance technology to dynamically build data source business data interactors to achieve data source types and types Counterattack of business types.

Benefits of technology

It improves system operation efficiency, saves system resources, improves development efficiency, systematic maintenance and scalability, supports the interaction of multiple data sources, and simplifies the interaction between business logic layers and data sources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376981A_ABST
    Figure CN119376981A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of civil aviation information, and discloses a civil aviation freight rate multi-data-source interaction device and method, and the device comprises a data interaction device factory manager, a data interaction device factory, and a data source business data interaction device. A data interaction device factory manager and a data interaction device factory are initialized, a data source service data interaction device is managed through the data interaction device factory, and the data source service data interaction device carries out data interaction according to the inheritance relation among a generalization data interaction interface, a data source data interaction interface and a data service interface. Realizing data interaction corresponding to the data source type and the service type; and returning the data source business data interaction device as response data requested by the business logic layer in a generalization mode. According to the technical scheme, the operation efficiency of the system is improved, and the development efficiency during system reconstruction and the maintainability and expandability of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of civil aviation information technology, and in particular to a device, method, equipment and medium for interacting with multiple data sources of civil aviation fares. Background Art

[0002] The civil aviation freight rate business is very complex. In the fully competitive global market environment, industry participants have developed an extremely complex pricing model over the past few decades. There are intricate associations, timings, and dependencies between civil aviation freight rate data, which can be described as a network organizational structure where "one move affects the whole body". In a simple transaction, the freight rate system needs to perform 100,000 data interactions and calculate hundreds of results that can be perceived by users in real time from a billion-level solution space. In order to optimize system performance, the data storage architecture has been reconstructed and the data storage method has been changed. Each reconstruction requires rewriting a large amount of data interaction code, so the design of data interaction has a direct impact on the performance and scalability of the system.

[0003] In order to meet the high performance requirements, the freight system is developed in C++ language. The data interaction technology framework of C++ technology stack is relatively rare, especially for civil aviation freight business. There is no relevant framework on the market. In order to take into account the system performance, improve the system scalability, and improve the efficiency of freight system data architecture reconstruction and development, the present invention provides a civil aviation freight multi-data source interaction device and method. Summary of the invention

[0004] To solve the above problems, the present invention provides a civil aviation fare multi-data source interaction device, method, equipment and medium, which improves the efficiency of system operation, saves system resources, and improves development efficiency, system maintainability and scalability.

[0005] To achieve the above object, the present invention adopts the following technical solution:

[0006] In a first aspect, the present invention provides a device for interacting with multiple data sources of civil aviation fares, comprising:

[0007] The data interactor factory manager is used to initialize the data source type in the data interactor factory manager according to the data source type specified in the civil aviation freight rate business logic layer request;

[0008] The data interactor factory is used to obtain the data source business data interactor according to the civil aviation freight rate business type specified in the civil aviation freight rate business logic layer request and the data source type in the data interactor factory manager;

[0009] The data source business data interactor is used to realize data interaction corresponding to the data source type and the business type according to the inheritance relationship between the generalized data interaction interface, the data source data interaction interface and the data business interface;

[0010] The data interactor factory manager is also used to return the data source business data interactor as the response data requested by the civil aviation freight rate business logic layer in a generalized manner.

[0011] Furthermore, the data interactor factory manager is also used to:

[0012] Initialize the data interactor factory manager as a global singleton;

[0013] Assign the data source type specified in the civil aviation business logic layer request to the data source type variable in the singleton.

[0014] Furthermore, the data interactor factory manager is also used to provide a member method for obtaining a single instance of the data interactor factory manager and a member method for obtaining a data source business data interactor.

[0015] Furthermore, in the implementation of the member method of obtaining the data source business data interactor, the data source business data interactor is obtained by calling the member method of the data interactor factory.

[0016] Furthermore, the data interactor factory is also used to provide a member method for obtaining a data source business data interactor corresponding to the data source type and the civil aviation fare business type.

[0017] Furthermore, the data source business data interactor is also used to implement the data source data interaction interface and the data business interface, and provide member methods for data interaction corresponding to the data source type and business type, and implement the corresponding data interaction in the member methods; the generalized data interaction interface is the base class of the data source data interaction interface, and the data source business data interactor indirectly implements the generalized data interaction interface by implementing the data source business data interactor.

[0018] Furthermore, the data interactor factory manager is also used to provide a member method for obtaining a data source business data interactor whose return data type is a generalized data interaction interface. In the implementation of the member method, the data source business data interactor that implements the generalized data interaction interface is returned as response data to the request of the civil aviation fare business logic layer.

[0019] In a second aspect, the present invention further provides a method for interacting with multiple data sources of civil aviation fares, comprising:

[0020] The data interactor factory manager initializes the data source type in the data interactor factory manager according to the data source type specified in the civil aviation freight rate business logic layer request;

[0021] The data interactor factory obtains the data source business data interactor according to the civil aviation freight rate business type specified in the civil aviation freight rate business logic layer request and the data source type in the data interactor factory manager;

[0022] The data source business data interactor implements data interaction corresponding to the data source type and business type according to the inheritance relationship between the generalized data interaction interface, the data source data interaction interface and the data business interface;

[0023] The data interactor factory manager returns the data source business data interactor as the response data requested by the civil aviation freight rate business logic layer in a generalized manner.

[0024] In a third aspect, the present invention further provides an electronic device, comprising: a processor and a memory;

[0025] The processor is coupled to the memory;

[0026] The processor is used to read and execute the program or instructions stored in the memory, so that the device executes the method of the second aspect.

[0027] In a fourth aspect, the present invention further provides a computer-readable storage medium storing a computer program, which implements the method of the second aspect when executed by a processor.

[0028] The technical solution provided by the present invention has at least the following technical effects or advantages:

[0029] The technical solution of the present invention is based on the C++ technology stack. Through the singleton mechanism of the data interactor factory manager in the global scope, it ensures that there is only one instance when the system is running, and provides a unified interface for obtaining the data source business data interactor in a generalized manner, thereby improving the efficiency of system operation, saving system resources, and facilitating global access and control. The data interactor factory model is based on the data source type and business type specified by the civil aviation fare business logic layer, combined with multiple inheritance technology, to dynamically build a data source business data interactor, realize the civil aviation fare data business componentization, and decouple the business logic layer from the data source. When the business logic layer adds a data source as needed, there is no need to modify the business logic layer code, and the components can be reused directly, which can significantly improve the development efficiency, maintainability and scalability of the system.

[0030] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 This is a schematic diagram of the structure of a device for interacting with multiple data sources of civil aviation fares in an embodiment of the present invention;

[0033] Figure 2 It is a schematic diagram of a process of interaction between multiple data sources of civil aviation freight rates in an embodiment of the present invention;

[0034] Figure 3 The present invention is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] The technical solution provided by the present invention is based on the C++ technology stack, combined with the business characteristics of civil aviation freight data, supports multiple data sources, provides a unified data interaction interface for the civil aviation freight business logic layer, decouples the business logic layer from the data layer, and does not need to modify the business logic layer code when the data source changes, greatly improving the maintainability and scalability of the system. At the same time, according to the civil aviation freight data standards and application standards, the data integrity check, accuracy check, preprocessing and other solidified businesses are independently encapsulated into data business components to achieve maximum reuse and improve development efficiency.

[0037] Figure 1 The structure diagram of a multi-data source interaction device for civil aviation fares in an embodiment of the present invention is shown in the figure. As shown in the figure, the device includes:

[0038] The data interactor factory manager is used to initialize the data source type in the data interactor factory manager according to the data source type specified in the civil aviation freight rate business logic layer request;

[0039] The data interactor factory is used to obtain the data source business data interactor according to the civil aviation freight rate business type specified in the civil aviation freight rate business logic layer request and the data source type in the data interactor factory manager;

[0040] The data source business data interactor is used to realize data interaction corresponding to the data source type and the business type according to the inheritance relationship between the generalized data interaction interface, the data source data interaction interface and the data business interface;

[0041] The data interactor factory manager is also used to return the data source business data interactor as the response data requested by the civil aviation freight rate business logic layer in a generalized manner.

[0042] The data interactor factory manager is a singleton class that manages the data interactor factories corresponding to various data source types. In the global scope of the civil aviation fare system, the corresponding data interactor factory is obtained from the corresponding data interactor factory according to the data source type specified in the civil aviation fare business logic layer request. Specifically, the data interactor factory manager is also used to initialize the data interactor factory manager as a singleton in the global scope; and assign the data source type specified in the civil aviation business logic layer request to the data source type variable in the singleton. Member methods for obtaining the data interactor factory manager singleton and member methods for obtaining the data source business data interactor are provided. In the implementation of the member method for obtaining the data source business data interactor, the data source business data interactor is obtained by calling the member method of the data interactor factory.

[0043] The data interactor factory is a factory class that manages all data source business data interactors corresponding to the data source type, and provides member methods for obtaining the corresponding data source business data interactors based on the data source type and the civil aviation fare business type.

[0044] The data source business data interactor implements the data source data interaction interface and the data business interface, and provides member methods for data interaction corresponding to the data source type and the business type, and implements the corresponding data interaction in the member methods; the generalized data interaction interface is the base class of the data source data interaction interface, and the data source business data interactor indirectly implements the generalized data interaction interface by implementing the data source business data interactor. The generalized data interaction interface is a pure virtual interface that provides a unified generalized data source business data interactor object for the civil aviation freight rate business logic layer. After the business logic layer obtains the generalized object, it converts it into a specific data source business data interactor as needed. The data source data interaction interface is an interface class that is bound to a specific data source, and implements direct interaction with the data source data in its derived class, and can provide a unified data operation interface for all data source business data interactors. The data business interface is an interface that is bound to a specific civil aviation data business, encapsulates all data operation behaviors corresponding to the civil aviation data business type, and provides integrity verification, accuracy verification, preprocessing, etc. of the data, which can realize the conversion of data in the data source and data objects in the civil aviation freight rate business logic layer.

[0045] The data interactor factory manager is also used to provide a member method for obtaining a data source business data interactor whose return data type is a generalized data interaction interface. In the implementation of the member method, the data source business data interactor that implements the generalized data interaction interface is returned as response data to the request of the civil aviation fare business logic layer.

[0046] It should be noted that, for the sake of convenience, Figure 1 For example, only the main modules of the civil aviation fare multi-data source interaction device structure are shown. In actual applications, the system may also include modules or components not shown in the figure; the system is not limited to the above-mentioned module or component structure, and may also be other module or component structures with the same technical concept.

[0047] Figure 2 The flowchart of a method for interacting with multiple data sources of civil aviation fares in an embodiment of the present invention is shown in the figure. As shown in the figure, the method includes:

[0048] S101. The data interactor factory manager initializes the data source type in the data interactor factory manager according to the data source type specified in the civil aviation freight rate business logic layer request;

[0049] S102, the data interactor factory obtains a data source business data interactor according to the civil aviation freight rate business type specified in the civil aviation freight rate business logic layer request and the data source type in the data interactor factory manager;

[0050] S103, the data source business data interactor implements data interaction corresponding to the data source type and the business type according to the inheritance relationship between the generalized data interaction interface, the data source data interaction interface and the data business interface;

[0051] S104. The data interactor factory manager returns the data source business data interactor as the response data requested by the civil aviation freight rate business logic layer in a generalized manner.

[0052] The technical solution of the present invention is further described below in conjunction with specific usage scenarios:

[0053] The technical solution of the present invention is implemented based on the C++ technology stack and supports the interaction of two data sources at the same time. Taking two data sources, Redis and OceanBase, as examples, the interactive design and operation method of the technical solution of the present invention are further explained. Redis is an open source, cross-platform, non-relational database that uses key-value pairs to store data; OceanBase is an enterprise-level native distributed relational database, and users interact with the database through SQL; SQL is a structured query language used to manage relational database management systems, which can access and process data in the database. The interaction methods of the two data sources, Redis and OceanBase, are different.

[0054] The data interactor factory manager is the DataInteractorHelper class, which is a singleton class with global scope, that is, when the system is running, there is only one singleton instance in the global scope. The DataInteractorHelper class is used to manage the data interactor factories of the two data sources, Redis and OceanBase. The member variable m_DataInteractorType is a data source enumeration type, which is used to save the current data source type. The member method setDataInteractorType provides an interface for setting the data source type; the member variable m_one is a static variable, which references the singleton instance of the DataInteractorHelper class, and the member method getInstance provides an interface for obtaining the singleton instance of the DataInteractorHelper class; the member method getDataInteractor obtains the specific data source business data interactor from the data interactor factory corresponding to the current data source type according to the specified civil aviation data business type, and returns the data source business data interactor in the form of a generalized interface.

[0055] The data interactor factory class corresponding to the Redis data source is the DataInteractorFactoryRedis class, which is used to manage all data source business data interactors corresponding to the Redis data source. The member variable m_dataInteractorRedis of the DataInteractorFactoryRedis class is used to save all data source business data interactors corresponding to the Redis data source; the member method getDataInteractor obtains the specific data source business data interactor according to the specified civil aviation data business type, and returns the data source business data interactor.

[0056] The data interaction factory class corresponding to the OceanBase data source is the DataInteractorFactoryOceanBase class, which is used to manage all data source business data interactors corresponding to the OceanBase data source. The member variable m_dataInteractorOceanBase of the DataInteractorFactoryOceanBase class is used to save all data source business data interactors corresponding to the OceanBase data source; the member method getDataInteractor obtains the specific data source business data interactor according to the specified civil aviation data business type, and returns the data source business data interactor.

[0057] DataInteractor is a generalized data interaction interface with no member variables or member methods. It is used to provide a basis for DataInteractorHelper, DataInteractorFactoryRedis, and

[0058] The member method getDataInteractor in the DataInteractorFactoryOceanBase class provides a unified and generalized data interaction object, that is, the member method getDataInteractor in the above class, and the returned data type is the DataInteractor interface type. The DataInteractor interface serves as the base class of the specific data source business data interactor.

[0059] DataInteractorRedis is a data interaction interface of Redis data source, which uses DataInteractor as the base class of the generalized data interaction interface. It directly interacts with the Redis data source, encapsulates the operation behavior of interacting with the Redis data source, and provides a unified data operation interface for all data source business data interactors of the Redis data source. The member method getValue searches and returns the corresponding value in Redis according to the specified key; setValue stores the corresponding key-value pair in Redis according to the specified key and value.

[0060] DataInteractorOceanBase is a data interaction interface based on DataInteractor, a generalized data interaction interface of OceanBase data source. It interacts directly with OceanBase data source, encapsulates the operation behavior of interacting with OceanBase data source, and provides a unified data operation interface for all data source business data interactors of OceanBase data source. The member method createSQL creates SQL statements according to the specified query conditions; the member method executeSQL executes the previously created SQL statement to access and process the data in OceanBase data source.

[0061] DataInteractorBusiness is a data business interface that is bound to a specific civil aviation data business. That is, it is an interface defined based on the type of civil aviation data business, with the DataInteractorBusiness interface as the base class, such as the DataInteractorRule interface bound to the rule data business and the DataInteractorFare interface bound to the price data business. The member method getObject of DataInteractorBusiness defines the method interface for interacting with the data in the data source. When the derived class implements this method interface, it needs to convert the data in the data source into a data object in the business logic layer and return it. Similarly, different civil aviation data businesses have different interfaces for binding. For example, the method interface for data interaction bound to the rule data business is getRule, and the method interface for data interaction bound to the price data business is getFare. In addition, before returning the data object, the integrity and accuracy of the data will be verified. For example, the price data is verified for missing field content according to the freight rate data standard, and the price data is verified for matching rule data according to the freight rate application standard. If there is no matching rule data, the price data is illegal. Then the price data is preprocessed, the price data structure is converted, and a member variable pointing to the memory address of the matching rule data is added. When interacting with rule data, there is no need to search for data according to the index. You can interact with the rule data directly through the memory address, which improves the efficiency of data interaction.

[0062] The data source business data interactor corresponding to the Redis data source is the DataInteractorBusinessRedis class, which implements the data business interface DataInteractorBusiness bound to the specific civil aviation data business and the data interaction interface DataInteractorRedis of the Redis data source. The DataInteractorBusinessRedis class has the functions of a dual interface, and can use the generalized data interaction interface to realize the mutual conversion between the Redis data source data interaction interface and the data business interface. For example, the data source business data interactor bound to the rule data business is the DataInteractorRuleRedis class, whose member method is getRule, which interacts with the rule data in the Redis data source, converts the rule data in the Redis data source into the rule data object in the business logic layer and returns it; the data source business data interactor bound to the price data business is the DataInteractorFareRedis class, whose member method is getFare, which interacts with the price data in the Redis data source, converts the price data in the Redis data source into the price data object in the business logic layer and returns it.

[0063] The data source business data interactor corresponding to the OceanBase data source is the DataInteractorBusinessOceanBase class, which implements the data business interface DataInteractorBusiness bound to the specific civil aviation data business and the data interaction interface DataInteractorRedis of the Redis data source. It has the functions of dual interfaces and can use the generalized data interaction interface to realize the mutual conversion between the Redis data source data interaction interface and the data business interface. For example, the data source business data interactor bound to the rule data business is the DataInteractorRuleOceanBase class, whose member method is getRule, which interacts with the rule data in the OceanBase data source, converts the rule data in the OceanBase data source into the rule data object in the business logic layer and returns it; the data source business data interactor bound to the price data business is the DataInteractorFareOceanBase class, which interacts with the price data in the OceanBase data source, converts the price data in the OceanBase data source into the price data object in the business logic layer and returns it.

[0064] During operation, when a civil aviation data service request is received from the civil aviation fare business logic layer, the data interactor factory manager is initialized according to the data source type specified in the request parameters, that is, the member method getInstance of the data interactor factory manager DataInteractorHelper is called to obtain the global instance of DataInteractorHelper, and then the member method setDataInteractorType is called to set the data source type corresponding to the current civil aviation data service request, and in subsequent civil aviation data service requests, the data source business data interactor corresponding to the data source type is provided to the civil aviation fare business logic layer.

[0065] In the subsequent civil aviation data service request process of the civil aviation fare business logic layer, according to the business type specified in the request parameters, the member method getInstance of the data interactor factory manager DataInteractorHelper is called to obtain the global instance of DataInteractorHelper, and then the member method getDataInteractor is called to obtain the specific data source business data interactor. During the execution of the member method getDataInteractor, the member method getDataInteractor of the data interactor factory corresponding to the set data source type is called to obtain the data source business data interactor corresponding to the specified business type. The data source business data interactor implements the data business interface DataInteractorBusiness and the generalized data interaction interface DataInteractor bound to the specific civil aviation data business. For example, when the set data source type is Redis, the data interactor factory corresponding to the data source type is DataInteractorFactoryRedis, and the member method getDataInteractor of DataInteractorFactoryRedis is called to obtain the data source business data interactor corresponding to the specified business type. When the data source type is set to OceanBase, the data interactor factory corresponding to the data source type is DataInteractorFactoryOceanBase. Call the member method getDataInteractor of DataInteractorFactoryOceanBase to obtain the data source business data interactor corresponding to the specified business type.

[0066] When the member method getDataInteractor of the data interactor factory manager DataInteractorHelper is called, the member method returns the data source business data interactor in a generalized manner, that is, the type of the data source business data interactor is the generalized data interaction interface DataInteractor type.

[0067] The civil aviation fare business logic layer obtains the data source business data interactor corresponding to the specified business type as a generalized data interaction interface DataInteractor type. According to the specified business type and C++ runtime type information, the C++ dynamic_cast method is used to convert the generalized data interaction interface into a specific data source business data interactor. After the civil aviation fare business logic layer obtains the specific data source business data interactor, it can operate the specific data source business data interactor to interact with the corresponding data source. For example, when the data source type specified by the civil aviation freight rate business logic layer is Redis and the business type is rule data business, the data source business data interactor DataInteractorRuleRedis can be operated to interact with the rule data in the Redis data source. DataInteractorRuleRedis can use the member method getValue inherited from the data interaction interface DataInteractorRedis of the Redis data source to interact with the Redis data source, or use the member method getRule of the DataInteractorRule interface bound to the rule data business to obtain the rule data object; when the data source type specified by the civil aviation freight rate business logic layer is OceanBase and the business type is price data business, the data source business data interactor DataInteractorFareOceanBase can be operated to interact with the price data in the OceanBase data source. DataInteractorFareOceanBase can use the member methods createSQL and executeSQL inherited from the data interaction interface DataInteractorOceanBase of the OceanBase data source to interact with the OceanBase data source, or use the member method getFare of the DataInteractorFare interface bound to the price data business to obtain the price data object.

[0068] This solution defines two types of data interaction interfaces: DataInteractorRedis for Redis data source and DataInteractorOceanBase for OceanBase data source. They encapsulate the public methods for interacting with Redis data source and OceanBase data source respectively. DataInteractorBusiness data business interface and member methods for data interaction are defined according to the business type. DataInteractorRuleRedis for data source business is a derived class of DataInteractorRedis and DataInteractorBusiness, and can interact with data in Redis data source; DataInteractorFareOceanBase for data source business is a derived class of DataInteractorOceanBase and DataInteractorBusiness, and can interact with data in OceanBase data source. Based on the solution, the business logic layer of civil aviation fares only relies on the data business interface DataInteractorBusiness, and implements the real data interaction method through the derived class data source business data interactor. When a new data source needs to be added, only a new set of data source business data interactor classes need to be implemented, which has no impact on the business logic and achieves a good decoupling effect.

[0069] The technical solution in the embodiments of the present invention has at least the following technical effects or advantages:

[0070] The technical solution of the present invention is based on the C++ technology stack. Through the singleton mechanism of the data interactor factory manager in the global scope, it ensures that there is only one instance when the system is running, and provides a unified interface for obtaining the data source business data interactor in a generalized manner, thereby improving the efficiency of system operation, saving system resources, and facilitating global access and control. The data interactor factory model is based on the data source type and business type specified by the civil aviation fare business logic layer, combined with multiple inheritance technology, to dynamically build a data source business data interactor, realize the civil aviation fare data business componentization, and decouple the business logic layer from the data source. When the business logic layer adds a data source as needed, there is no need to modify the business logic layer code, and the components can be reused directly, which can significantly improve the development efficiency, maintainability and scalability of the system.

[0071] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. As shown in the figure, the electronic device includes: a processor and a memory;

[0072] The processor is used to read and execute programs and instructions stored in the memory, so that the electronic device executes the above method embodiment.

[0073] It should be noted that, for the sake of convenience, Figure 3 For example, only the main components of the electronic device are shown. In actual applications, the electronic device may also include components or assemblies not shown in the figure.

[0074] The present invention also provides a computer-readable storage medium storing a program or instruction. When a computer reads and executes the program or instruction, the computer executes the above method embodiment.

[0075] Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-data source interactive device for civil aviation freight rates, characterized in that: include: The data interactor factory manager is used to initialize the data source type in the data interactor factory manager according to the data source type specified in the civil aviation freight rate business logic layer request; The data interactor factory is used to obtain the data source business data interactor according to the civil aviation freight rate business type specified in the civil aviation freight rate business logic layer request and the data source type in the data interactor factory manager; The data source business data interactor is used to realize data interaction corresponding to the data source type and the business type according to the inheritance relationship between the generalized data interaction interface, the data source data interaction interface and the data business interface; The data interactor factory manager is also used to return the data source business data interactor as the response data requested by the civil aviation freight rate business logic layer in a generalized manner.

2. The civil aviation fare multi-data source interaction device according to claim 1, characterized in that: The data interactor factory manager is further used for: Initialize the data interactor factory manager as a global singleton; The data source type specified in the civil aviation business logic layer request is assigned to the data source type variable in the singleton.

3. The civil aviation fare multi-data source interaction device according to claim 1, characterized in that: The data interactor factory manager is also used to provide a member method for obtaining a single instance of the data interactor factory manager and a member method for obtaining a data source business data interactor.

4. The civil aviation fare multi-data source interaction device according to claim 3, characterized in that: In the implementation of the member method for obtaining the data source business data interactor, the data source business data interactor is obtained by calling the member method of the data interactor factory.

5. The civil aviation fare multi-data source interaction device according to claim 1, characterized in that: The data interactor factory is also used to provide a member method for obtaining a data source business data interactor corresponding to a data source type and a civil aviation fare business type.

6. The civil aviation fare multi-data source interaction device according to any one of claims 1 to 5, characterized in that: The data source business data interactor is also used to implement the data source data interaction interface and the data business interface, and provides member methods for data interaction corresponding to the data source type and the business type, and implements the corresponding data interaction in the member methods; the generalized data interaction interface is the base class of the data source data interaction interface, and the data source business data interactor indirectly implements the generalized data interaction interface by implementing the data source business data interactor.

7. The civil aviation fare multi-data source interaction device according to claim 6, characterized in that: The data interactor factory manager is also used to provide a member method for obtaining a data source business data interactor whose return data type is a generalized data interaction interface. In the implementation of the member method, the data source business data interactor that implements the generalized data interaction interface is returned as response data to the request of the civil aviation fare business logic layer.

8. A method for interacting with multiple data sources of civil aviation freight rates, characterized in that: include: The data interactor factory manager initializes the data source type in the data interactor factory manager according to the data source type specified in the civil aviation freight rate business logic layer request; The data interactor factory obtains the data source business data interactor according to the civil aviation freight rate business type specified in the civil aviation freight rate business logic layer request and the data source type in the data interactor factory manager; The data source business data interactor implements data interaction corresponding to the data source type and business type according to the inheritance relationship between the generalized data interaction interface, the data source data interaction interface and the data business interface; The data interactor factory manager returns the data source business data interactor as the response data requested by the civil aviation freight rate business logic layer in a generalized manner.

9. An electronic device, characterized in that: include: Processor and memory; The processor is coupled to the memory; The processor is used to read and execute the program or instruction stored in the memory, so that the device executes the method as claimed in claim 8.

10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the program is executed by a processor, the method according to claim 8 is implemented.