Message conversion method, device and electronic equipment
By obtaining the version information of NDC messages, sharding and parsing, and combining multiple analysis strategies, the problem of low processing efficiency of NDC version messages in the existing technology is solved, and efficient message conversion and widespread application goals are achieved.
Patent Information
- Application Number
- CN202011083977.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-12
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2040-10-12
AI Technical Summary
The existing packet analysis method is inefficient when processing packets of multiple NDC versions and cannot adapt to the conversion requirements in complex scenarios.
By obtaining the version information of the message, determining the target conversion template, and using this template to shard and parse the message, combining multiple parsing strategies (such as the current thread, parallel streaming and large task sharding strategies) for analysis and aggregation and aggregation , generate the target version of the packet.
It improves the efficiency of packet resolution, expands the applicable scenarios of packet conversion, and realizes efficient processing of packets for different versions of NDC standards.
Smart Images

Figure CN112214968B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a message conversion method, device and electronic equipment. Background Art
[0002] NDC (New Distribution Capability) is a new distribution industry standard that the International Air Transport Association (IATA) has been promoting in recent years. It mainly develops a unified data transmission standard (XML), through which airlines and their partners can exchange data. Airlines can dynamically and in real time build flight fares, air tickets and ancillary products based on sellers' requests and information from sellers and passengers, and then provide them to sellers through unified standards, changing the traditional air ticket field where products are mainly built by the Global Distribution System (GDS), and promoting direct sales by airlines.
[0003] However, NDC has multiple versions, and there are large gaps between them. In addition, each airline may use a different NDC version. Therefore, the aggregator needs to process each NDC version of the airline and output NDC messages of the same standard. The existing message parsing methods are limited in application platform and have low parsing efficiency for messages with large data volumes. They are no longer suitable for message conversion needs in complex scenarios. Summary of the invention
[0004] In view of the above problems, the present invention provides a message conversion method, device and electronic device, which achieves the purpose of wide application scenarios and high processing efficiency for the conversion of different versions of messages oriented to the NDC standard.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A message conversion method, comprising:
[0007] Get the message requested by the user;
[0008] Parsing the message to obtain version information of the message;
[0009] Based on the version information, determining a target conversion template, the target conversion template being a first conversion template or a second conversion template, the first conversion template being a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template representing an extensible style sheet language conversion processing template;
[0010] Using the target conversion module to fragment the message to obtain a plurality of message fragments;
[0011] Parsing the message fragment using a message parsing strategy that matches the message fragment to obtain a parsing result of the message fragment;
[0012] The parsing results of the message fragments are aggregated to obtain a message of a target version.
[0013] A message conversion device, comprising:
[0014] An acquisition unit, used for acquiring a message requested by a user;
[0015] A first parsing unit, used to parse the message to obtain version information of the message;
[0016] a determining unit, configured to determine a target conversion template based on the version information, wherein the target conversion template is a first conversion template or a second conversion template, wherein the first conversion template is a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template represents an extensible style sheet language conversion processing template;
[0017] A fragmentation unit, used for fragmenting the message using the target conversion module to obtain a plurality of message fragments;
[0018] A second parsing unit, configured to parse the message fragment by using a message parsing strategy matching the message fragment to obtain a parsing result of the message fragment;
[0019] The aggregation unit is used to aggregate the parsing results of the message fragments to obtain a target version of the message.
[0020] A storage medium stores executable instructions, which, when executed by a processor, implement the message conversion method described in any one of the above.
[0021] An electronic device, comprising:
[0022] Memory, used to store programs;
[0023] A processor is used to execute the program, wherein the program is specifically used to:
[0024] Get the message requested by the user;
[0025] Parsing the message to obtain version information of the message;
[0026] Based on the version information, determining a target conversion template, the target conversion template being a first conversion template or a second conversion template, the first conversion template being a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template representing an extensible style sheet language conversion processing template;
[0027] Using the target conversion module to fragment the message to obtain a plurality of message fragments;
[0028] Parsing the message fragment using a message parsing strategy that matches the message fragment to obtain a parsing result of the message fragment;
[0029] The parsing results of the message fragments are aggregated to obtain a message of a target version.
[0030] Compared with the prior art, the present invention provides a message conversion method, device and electronic device, which obtains the message requested by the user; parses the message to obtain the version information of the message; determines the target conversion template based on the version information; uses the target conversion module to fragment the message to obtain a number of message fragments; parses the message fragments through a message parsing strategy that matches the message fragments to obtain the parsing results of the message fragments; aggregates the parsing results of the message fragments to obtain the target version of the message. In the present invention, the message parsing efficiency is improved by matching the message to the optimal strategy through a variety of parsing strategies, and the adaptability of the message conversion is wider based on different conversion modules, thereby achieving the purpose of wide application scenarios and high processing efficiency for the conversion of different versions of messages for the NDC standard. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals identify the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0032] Figure 1 A schematic diagram of a flow chart of a message conversion method provided by an embodiment of the present invention;
[0033] Figure 2 A schematic diagram of a message conversion process provided by an embodiment of the present invention;
[0034] Figure 3 A schematic diagram of initializing an airline component provided by an embodiment of the present invention;
[0035] Figure 4 A schematic diagram of an initialization shard resolution strategy component provided by an embodiment of the present invention;
[0036] Figure 5 A schematic diagram of a template loading pool provided by an embodiment of the present invention;
[0037] Figure 6 A schematic diagram of an initialization message fragmentor provided in an embodiment of the present invention;
[0038] Figure 7 A schematic diagram of assembling a message translator provided in an embodiment of the present invention;
[0039] Figure 8 A schematic diagram of the structure of a message conversion device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0041] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0042] It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. The modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0043] A message conversion method provided by an embodiment of the present invention is a method for converting messages of different versions of the NDC standard. It adopts a template conversion method, combined with corresponding parsing strategies, and adopts different parsing strategies for different scenarios to achieve the optimal processing method. For example, the large task fragmentation parsing strategy for large messages is 3-4 times faster than the traditional solution. Different parsing methods can be adopted according to different versions and even different interfaces of different airlines, which improves the flexibility of the message conversion system.
[0044] In order to facilitate the description of the message conversion method provided by the present invention, relevant terms to which the present invention is applied are explained.
[0045] NDC (New Distribution Capability) is a new distribution industry standard that the International Air Transport Association (IATA) has been promoting in recent years. The new distribution capability mainly develops a unified data transmission standard based on XML format messages, and airlines and their partners can use this unified standard to exchange data. Airlines can dynamically and in real time build flight fares, air ticket products and ancillary products based on sellers' requests and information from sellers and passengers (the product quotes built and returned by airlines to partners are what is often called Offers in NDC), and then provide them to sellers through unified XML format standard messages. This design changes the traditional model in the air ticket field where GDS mainly builds Offers for distribution, allowing airlines to return to the dominant position in transactions and promote direct sales by airlines.
[0046] AirlineAdaptor: airline component.
[0047] AirShopping: Based on the query conditions such as the departure place, arrival place and travel date, the system returns the airlines, flights, cabins, fares and other information that meet the conditions for users to choose from.
[0048] SeatAvail: Used to obtain the flight seat map and seat status, based on which users can select seats.
[0049] ServiceList: It can be used to view the additional service products that can be purchased for the flight. Users can purchase additional services before booking, or add additional services after ticketing.
[0050] OrderReshop: Users use this interface to send the flight and EMD information to be changed to the airline. After the airline calculates the price, it will return the detailed cost required for the change.
[0051] DataList, OffersGroup, AugmentationPoint, Utils: These are all nodes in the flight query return message.
[0052] Offer: The information returned by the airline, such as flight space, brand fare, additional services, usage rules, etc., is called an offer. Each Offer can have multiple OfferItems, one OfferItem for each passenger type and one OfferItem for each additional service.
[0053] ITI mode: ITI mode means that when the itinerary is a round trip, the airline's AirShopping interface will return the package combination result of the outbound / return flight fare. Each Offer is the quotation result of the entire itinerary (that is, a outbound / return flight combination).
[0054] OWD mode: OWD mode means that the AirShopping interface returns the outbound / return flight fare results separately, that is, there is an offer for each trip. When using it, users need to combine the outbound / return offers into an offer for the entire trip.
[0055] NDC message: NDC mainly develops a unified data transmission standard based on XML format messages, through which airlines and their partners can exchange data. These unified standard messages are NDC messages. NDC messages are presented in XML format documents, and the definition files for these XML format documents are the corresponding XSD files. Whether XSD files or XML files, they comply with their own technical specifications. For example, there are some "nodes", "attributes" and other contents, which are all standard technical definitions.
[0056] NDC interface: OOMS is the carrier for airlines to implement NDC. Due to the diversity of business links and process scenarios in the airline sales process, OOMS must provide various interfaces to meet the needs of interaction in the entire business process. For example, common NDC interfaces include: AirShopping (Offer query, providing users with the function of querying the required products), OrderCreate (Order generation, providing users with the function of placing orders with airline OOMS), OrderRetrieve (Order retrieval, providing users with the function of requesting airlines to view the status of booked orders), etc. Different interfaces use their own NDC messages.
[0057] NDC version: NDC is a relatively new and continuously developing project, and IATA is also continuously optimizing and improving NDC. This is reflected in the specific deliverables, that is, NDC messages will release two updated and iterative versions every year (for all NDC interfaces), and their version numbers are composed of "year" and "version number". For example, the second version released in 2017 is version 17.2; the first version released in 2018 is 18.1, etc.
[0058] See also Figure 1 , which shows a flow chart of a message conversion method provided by an embodiment of the present invention, which may include the following steps:
[0059] S101: Obtain a message requested by a user.
[0060] S102: Parse the message to obtain version information of the message.
[0061] Obtaining the message requested by the user usually refers to obtaining the XML message requested by the user. <messagedoc> <name> AA< / name> < / messagedoc> The parameters in the node and http request header can obtain the version information of the message.
[0062] It should be noted that when obtaining the user's request, it is also necessary to verify the airline component corresponding to the request, that is, to parse the message of the user's request and obtain the airline component corresponding to the message; if the airline component meets the verification conditions, obtain the version information corresponding to the message; if the airline component does not meet the verification conditions, generate a prompt message, and the prompt message is used to prompt that the airline component is abnormal.
[0063] For example, based on the above parameters, the AirShopping interface belonging to AA Airlines version 182 is determined, and then the corresponding airline component is obtained from the system memory. First, it is determined whether the airline component is "alive". If it is "alive", it is determined whether the message uses the Xalan template or Saxon template conversion according to the airline interface configuration. If the airline component is "dead", it directly returns to the user that the airline interface is abnormal. Among them, "alive" can be understood as still being used, and "dead" can be understood as the airline component is not used.
[0064] S103: Determine a target conversion template based on the version information.
[0065] The version information can be matched with the conversion template one by one, and the corresponding target conversion template can be obtained after the version information is obtained. A message translator can also be obtained based on the version information, so that the message translator loads the target conversion template based on the interface information of the version information.
[0066] In the embodiment of the present invention, the target conversion template is a first conversion template or a second conversion template, the first conversion template is a template for converting an extensible markup language into a hypertext link markup language or other types of extensible markup language documents, and the second conversion template represents an extensible style sheet language conversion processing template. The first conversion template is xlstxalan, and the second conversion template can be xslt saxon.
[0067] Specifically, the conversion and parsing process based on the AirShopping interface of AA Airlines is used as an example. According to the obtained airline component and NDC version number, the translator of the message can be obtained. The translator will automatically load the Saxon template of the AirShopping interface of AA Airlines version 182 from the system template pool. If the Xalan template is configured, the Xalan template will be loaded here.
[0068] S104: Use the target conversion module to fragment the message to obtain a plurality of message fragments.
[0069] Still taking the above example, the message translator will automatically load a message fragmenter according to the loaded xslt template and AA airline component, which will divide the xml message into multiple small segments. Here, the AirShopping message of AA airline will be split into four segments: DataList, OffersGroup, AugmentationPoint, and Utils, and then the system will start four threads to parse these four small segments in parallel.
[0070] S105: Parse the message fragment using a message parsing strategy that matches the message fragment to obtain a parsing result of the message fragment.
[0071] In one implementation of the present invention, the weight value of the message may be calculated based on the target conversion template corresponding to the message, version information and the size of the message; and the message parsing strategy may be determined based on the weight value.
[0072] Among them, the message parsing strategy includes: current thread parsing strategy, large task slice parsing strategy and parallel streaming parsing strategy; wherein, the current thread parsing strategy is used to parse messages whose number of nodes is less than a preset number threshold; the parallel streaming parsing strategy parsing strategy is used to parse messages whose size is greater than a preset first threshold and less than a preset second threshold through multiple threads; the large task slice parsing strategy is used to parse messages whose size is greater than a preset third threshold, and the third threshold is greater than the second threshold.
[0073] For example, the AA Airlines component can be used to obtain the fragmentation resolution strategy of the AA Airlines. The fragmentation resolution strategy component will automatically calculate a weight value for the AirShopping interface message resolution. First, the interface weight of the 182 version of the AirShopping interface of the AA Airlines is 5; the DataList and OffersGroup fragment message size greater than 5M will get a weight of 50, the AugmentationPoint fragment message less than 2M will get a weight of 5, and the Utils fragment message greater than 2M and less than 5M will get a weight of 20; then the DataList and OffersGroup fragment message nodes above 5000 will get a weight of 45, the AugmentationPoint fragment message nodes below 10 will get a weight of 2, and the Utils fragment message nodes above 100 and below 1000 will get a weight of 20; then it is determined that the xml is in OWD mode and gets a weight of 5. Finally, through calculation, it is found that the weight of the DataList and OffersGroup fragments is 105. According to the fragmentation parsing strategy, it is judged that the fragment message should adopt the large task fragmentation parsing strategy; the weight of the AugmentationPoint fragment is 17. According to the fragmentation parsing strategy, it is judged that the fragment message should adopt the current thread parsing strategy; the weight of the Utils fragment is 50. According to the fragmentation parsing strategy, it is judged that the fragment message should adopt the parallel streaming parsing strategy.
[0074] When the DataList and OffersGroup fragments adopt the large task sharding parsing strategy, the system will calculate the number of functions that need to be executed, split the functions into groups of 20, start 4 threads for each group of functions to perform parsing concurrently, and after each group of functions is executed, the results will be placed in the system cache, and then continue to execute the next group of functions.
[0075] The AugmentationPoint fragment adopts the current thread strategy. The system will start a thread to parse this fragment, and the parsing result is also placed in the system cache.
[0076] The Utils segment adopts a parallel streaming parsing strategy. First, the system puts all the functions that need to be executed into a queue, and then starts 5 threads. Each thread gets a function from the queue and executes the parsing concurrently. The parsing results are also put into the system cache.
[0077] S106: Aggregate the parsing results of the message fragments to obtain a message of a target version.
[0078] For example, the parsing result of the message is obtained from the cache and aggregated into a message that complies with the NDC version 182. This version of the message is a message that complies with the NDC standard.
[0079] The present invention provides a message conversion method, which obtains a message requested by a user; parses the message to obtain version information of the message; determines a target conversion template based on the version information; segments the message using a target conversion module to obtain a plurality of message segments; parses the message segments using a message parsing strategy that matches the message segments to obtain parsing results of the message segments; aggregates the parsing results of the message segments to obtain a target version of the message. In the present invention, a plurality of parsing strategies are used to match the message to the optimal strategy, thereby improving the message parsing efficiency, and based on different conversion modules, the message conversion has a wider range of adaptability, thereby achieving the purpose of wide application scenarios and high processing efficiency for the conversion of different versions of messages for the NDC standard.
[0080] The message processing system of the present invention is taken as an example to illustrate the message conversion method. The system involves components including: template conversion mode: xlst xalan template conversion, xslt saxon template conversion; fragmentation parsing strategy components: current thread parsing strategy, large task fragmentation parsing strategy, parallel streaming parsing strategy; message fragmentation component. Figure 2 As shown, it shows a schematic diagram of a message conversion process.
[0081] Xalan Template Transformation: Xalan is a specification for converting Extensible Markup Language (XML) to Hypertext Markup Language (HTML) or other types of XML documents. Xalan-Java 1.2 is based on the Extensible Stylesheet Language Transformations (XSLT) and XML Path Language (XPL) of the Internet Consortium (W3C). Usually Xalan uses the Xerces XML lexical analyzer, but it can also use other analyzers to convert to the Document Object Model (DOM) 2 or the Simple API for XML (SAX) 1. After a lot of testing, using xalan templates to convert small messages is faster and has less system overhead.
[0082] Saxon Template Transformation: Saxon is an XSLT processor, which is a program that uses XML documents and style sheets as input and then generates result documents as output. It can be used with other parsers that implement the Java SAX interface. Saxon also includes a serializer for converting the result tree into XML, HTML, or plain text. Good performance is certainly one of the reasons why we chose Saxon. After a lot of testing, Saxon has a clear speed advantage in parsing large messages. When parsing the AirShopping message, the Saxon template is used.
[0083] Message fragmenter component: The message fragmenter component mainly adopts different fragmentation strategies for different interfaces of different airlines. It will split large messages into multiple small fragments, each of which will be parsed in a different thread. Generally, messages with similar nodes will be split together.
[0084] Sharding parsing strategy component: The AirlineAdaptor initialized by the system determines the airline, interface, xslt template used for conversion, NDC version number, and message size of the message to calculate a weight value, and then determines the message to be parsed using the following three parsing strategies based on the weight value to ensure that the message is always parsed using the optimal strategy. A large number of system test results often show that when the weight value is above 100, the large task sharding parsing strategy is used, when the weight value is between 20-100, the parallel streaming parsing strategy is used, and when the weight value is less than 20, the current thread parsing strategy is used. This parsing strategy can achieve the optimal solution in terms of parsing speed and system overhead.
[0085] (1) Current thread parsing strategy: Small messages with fewer nodes are usually parsed in a single-threaded manner to prevent frequent thread context switching and save system overhead.
[0086] (2) Large task fragmentation parsing strategy: For large messages with many fragments, we usually split the large task into N small tasks, and execute each N small tasks in parallel to further improve the parsing speed of large messages. This is mainly for the parsing of AirShopping, SeatAvail, and ServiceList messages.
[0087] (3) Parallel streaming parsing strategy: When using streaming processing, when the data volume is large, multiple threads can be started through parallel streaming to perform processing. Each thread performs a fragment of message parsing. When parsing AirShopping messages, the speed is not as fast as the large task fragmentation parsing strategy. However, when parsing OrderReshop messages, the system overhead is greatly reduced on the basis of almost the same speed, and the optimal parsing is achieved in this scenario.
[0088] See also Figure 3, which shows a schematic diagram of initializing airline components provided by an embodiment of the present invention. The configuration of each airline is defined as an airline component. The system will load the components of each airline at startup, and load components of different airlines and different versions into the corresponding version of NDC components. For example: AGG currently supports the NDC182 version, so the AA airline version 172 component is loaded into the NDC182 component, thereby obtaining the configuration information required for the conversion from version 172 to version 182 or from version 182 to version 172. At the same time, the system will send an http request to the airline based on the provided http client component to check whether the airline is alive. If the airline returns successfully, it is set to 'alive', and if it returns an exception, it is set to 'dead'. When a user requests a 'dead' airline interface, the system will automatically prompt the customer that the airline interface is abnormal.
[0089] See also Figure 4 , which shows a schematic diagram of an initialization shard resolution strategy component provided by an embodiment of the present invention. When the system starts, the corresponding shard resolution strategy component will be generated according to the initialized airline component, and the shard resolution strategy component of each airline is different. The generation of the shard resolution strategy component mainly depends on the airline, interface, size, number of nodes, NDC version, xml's OWD and ITI mode of the message. The system will first generate a default weight value based on these conditions. For example, the default weight value of the AirShopping interface is 5, the weight value of the OfficePrice interface is 3, etc.; when the message is greater than 5M, the default weight value is 50, and the default weight value of the message is greater than or equal to 2M and less than 5M is 20, and the default weight value of less than 2M is 5, etc. When a message is received, the system will accumulate and calculate a total weight value based on the default weight values configured for the airline, interface, size, number of nodes, NDC version, xml's OWC and ITI mode of the message. When the value is less than or equal to 20, the current thread parsing strategy is executed; when the value is greater than 20 and less than or equal to 100, the parallel streaming parsing strategy is executed; when the value is greater than 100, the large task sharding parsing strategy is executed. This value is different for different airlines.
[0090] See also Figure 5 , which shows a schematic diagram of a template pool loading provided by an embodiment of the present invention. When the system starts, the xslt template corresponding to each interface of each airline is loaded by initializing the configuration of the airline component. The system loads the Xalan template into the Xalan pool and the Saxon template into the Saxon pool through the template factory.
[0091] See also Figure 6, which shows a schematic diagram of an initialization message fragmenter provided by an embodiment of the present invention. When the system starts, the larger messages are fragmented according to the airline components, and a large message is split into small messages containing multiple nodes for concurrent parsing. For example: the return message of AirShopping, the system will split it into multiple small messages containing DataList, OffersGroup, AugmentationPoint, etc. for concurrent parsing to improve the parsing speed.
[0092] See also Figure 7 , which shows a schematic diagram of assembling a message translator provided by an embodiment of the present invention. After initializing the above components, the system will automatically collect these components to assemble a translator for each airline's interface. When the user calls the AGG interface, the user will determine which translator to use to parse the message based on the airline, interface, and version of the message.
[0093] The message conversion method provided by the embodiment of the present invention is much faster than the traditional XML parsing in terms of parsing speed, and implements multiple sets of parsing strategies. According to the parsing strategy rules, the optimal solution for message parsing can always be found, which can effectively reduce system overhead while ensuring the parsing speed. Most of the various rule components described in the system are universal. When a new airline is connected, you only need to write the corresponding xslt template and load the new airline component into the system. Because the system architecture is based on componentized development, the optimal parsing strategy components can be customized and developed according to different versions and different interfaces of different airlines without destroying the system architecture. This meets the efficient performance requirements of the NDC aggregator.
[0094] See also Figure 8 In an embodiment of the present invention, a message conversion device is also provided, the device comprising:
[0095] The acquisition unit 10 is used to acquire the message requested by the user;
[0096] A first parsing unit 20, configured to parse the message to obtain version information of the message;
[0097] A determination unit 30 is used to determine a target conversion template based on the version information, wherein the target conversion template is a first conversion template or a second conversion template, wherein the first conversion template is a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template represents an extensible style sheet language conversion processing template;
[0098] A fragmentation unit 40, configured to fragment the message using the target conversion module to obtain a plurality of message fragments;
[0099] A second parsing unit 50, configured to parse the message fragment using a message parsing strategy that matches the message fragment to obtain a parsing result of the message fragment;
[0100] The aggregation unit 60 is used to aggregate the parsing results of the message fragments to obtain a message of a target version.
[0101] Based on the above embodiment, the determining unit is specifically used for:
[0102] Based on the version information, a message translator is obtained, so that the message translator loads a target conversion template based on the interface information of the version information.
[0103] Based on the above embodiment, the device further includes:
[0104] A calculation unit, used to calculate the weight value of the message according to the target conversion template corresponding to the message, the version information and the size of the message;
[0105] A policy determination unit is used to determine a message parsing policy according to the weight value.
[0106] Based on the above embodiment, the message parsing strategy includes: current thread parsing strategy, large task slice parsing strategy and parallel streaming parsing strategy; wherein,
[0107] The current thread parsing strategy is used to parse messages whose number of nodes is less than a preset number threshold; the parallel streaming parsing strategy is used to parse messages whose size is greater than a preset first threshold and less than a preset second threshold through multiple threads; the large task slicing parsing strategy is used to parse messages whose size is greater than a preset third threshold, and the third threshold is greater than the second threshold.
[0108] Based on the above embodiment, the device further includes:
[0109] A third parsing unit, configured to parse the message requested by the user to obtain an airline component corresponding to the message;
[0110] The acquisition unit is further used to acquire version information corresponding to the message if the airline component meets the verification condition;
[0111] A generating unit is used to generate a prompt message if the airline component does not meet the verification conditions, and the prompt message is used to prompt that the airline component is abnormal.
[0112] It should be noted that the flowcharts and block diagrams in the accompanying drawings in the embodiments illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0113] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes, and are not used to limit the scope of these messages or information. Although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. It should be understood that the various steps recorded in the method embodiments of the present disclosure can be performed in different orders, and / or performed in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0114] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0115] In an embodiment of the present invention, a storage medium is further provided, on which executable instructions are stored. When the instructions are executed by a processor, the message conversion method as described in any one of the above items is implemented.
[0116] An embodiment of the present invention further provides an electronic device, including:
[0117] Memory, used to store programs;
[0118] A processor is used to execute the program, wherein the program is specifically used to:
[0119] Get the message requested by the user;
[0120] Parsing the message to obtain version information of the message;
[0121] Based on the version information, determining a target conversion template, the target conversion template being a first conversion template or a second conversion template, the first conversion template being a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template representing an extensible style sheet language conversion processing template;
[0122] Using the target conversion module to fragment the message to obtain a plurality of message fragments;
[0123] Parsing the message fragment using a message parsing strategy that matches the message fragment to obtain a parsing result of the message fragment;
[0124] The parsing results of the message fragments are aggregated to obtain a message of a target version.
[0125] Further, determining the target conversion template based on the version information includes:
[0126] Based on the version information, a message translator is obtained, so that the message translator loads a target conversion template based on the interface information of the version information.
[0127] Furthermore, the method further comprises:
[0128] Calculate the weight value of the message according to the target conversion template corresponding to the message, the version information and the size of the message;
[0129] A message parsing strategy is determined based on the weight value.
[0130] Furthermore, the message parsing strategy includes: current thread parsing strategy, large task slicing parsing strategy and parallel streaming parsing strategy; wherein,
[0131] The current thread parsing strategy is used to parse messages whose number of nodes is less than a preset number threshold; the parallel streaming parsing strategy is used to parse messages whose size is greater than a preset first threshold and less than a preset second threshold through multiple threads; the large task slicing parsing strategy is used to parse messages whose size is greater than a preset third threshold, and the third threshold is greater than the second threshold.
[0132] Furthermore, the method further comprises:
[0133] Parsing the message requested by the user to obtain the airline component corresponding to the message;
[0134] If the airline component meets the verification conditions, obtain the version information corresponding to the message;
[0135] If the airline component does not meet the verification conditions, a prompt message is generated, and the prompt message is used to indicate that the airline component is abnormal.
[0136] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0137] According to one or more embodiments of the present disclosure, a threat modeling-oriented information processing method, system, storage medium, and electronic device are provided.
[0138] A message conversion method, comprising:
[0139] Get the message requested by the user;
[0140] Parsing the message to obtain version information of the message;
[0141] Based on the version information, determining a target conversion template, the target conversion template being a first conversion template or a second conversion template, the first conversion template being a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template representing an extensible style sheet language conversion processing template;
[0142] Using the target conversion module to fragment the message to obtain a plurality of message fragments;
[0143] Parsing the message fragment using a message parsing strategy that matches the message fragment to obtain a parsing result of the message fragment;
[0144] The parsing results of the message fragments are aggregated to obtain a message of a target version.
[0145] A message conversion device, comprising:
[0146] An acquisition unit, used for acquiring a message requested by a user;
[0147] A first parsing unit, used to parse the message to obtain version information of the message;
[0148] a determining unit, configured to determine a target conversion template based on the version information, wherein the target conversion template is a first conversion template or a second conversion template, wherein the first conversion template is a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template represents an extensible style sheet language conversion processing template;
[0149] A fragmentation unit, used for fragmenting the message using the target conversion module to obtain a plurality of message fragments;
[0150] A second parsing unit, configured to parse the message fragment by using a message parsing strategy matching the message fragment to obtain a parsing result of the message fragment;
[0151] The aggregation unit is used to aggregate the parsing results of the message fragments to obtain a target version of the message.
[0152] A storage medium stores executable instructions, which, when executed by a processor, implement the message conversion method described in any one of the above.
[0153] An electronic device, comprising:
[0154] Memory, used to store programs;
[0155] A processor is used to execute the program, wherein the program is specifically used to:
[0156] Get the message requested by the user;
[0157] Parsing the message to obtain version information of the message;
[0158] Based on the version information, determining a target conversion template, the target conversion template being a first conversion template or a second conversion template, the first conversion template being a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template representing an extensible style sheet language conversion processing template;
[0159] Using the target conversion module to fragment the message to obtain a plurality of message fragments;
[0160] Parsing the message fragment using a message parsing strategy that matches the message fragment to obtain a parsing result of the message fragment;
[0161] The parsing results of the message fragments are aggregated to obtain a message of a target version.
[0162] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
[0163] Although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0164] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
Claims
1. A message conversion method, characterized in that: include: Get the message requested by the user; Parsing the message to obtain version information of the message; Based on the version information, determining a target conversion template, the target conversion template being a first conversion template or a second conversion template, the first conversion template being a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template representing an extensible style sheet language conversion processing template; Using the target conversion template to fragment the message to obtain a plurality of message fragments; Parsing the message fragment using a message parsing strategy that matches the message fragment to obtain a parsing result of the message fragment; Aggregating the parsing results of the message fragments to obtain a target version of the message; The method further comprises: Calculate the weight value of the message according to the target conversion template corresponding to the message, the version information and the size of the message; Determining a message parsing strategy based on the weight value; The message parsing strategies include: current thread parsing strategy, large task slicing parsing strategy and parallel streaming parsing strategy; wherein, The current thread parsing strategy is used to parse messages whose number of nodes is less than a preset number threshold; the parallel streaming parsing strategy is used to parse messages whose size is greater than a preset first threshold and less than a preset second threshold through multiple threads; the large task slicing parsing strategy is used to parse messages whose size is greater than a preset third threshold, and the third threshold is greater than the second threshold.
2. The method according to claim 1, characterized in that The step of determining a target conversion template based on the version information includes: Based on the version information, a message translator is obtained, so that the message translator loads a target conversion template based on the interface information of the version information.
3. The method according to claim 1, characterized in that: The method further comprises: Parsing the message requested by the user to obtain the airline component corresponding to the message; If the airline component meets the verification conditions, obtain the version information corresponding to the message; If the airline component does not meet the verification conditions, a prompt message is generated, and the prompt message is used to indicate that the airline component is abnormal.
4. A message conversion device, characterized in that: include: An acquisition unit, used for acquiring a message requested by a user; A first parsing unit, used to parse the message to obtain version information of the message; a determining unit, configured to determine a target conversion template based on the version information, wherein the target conversion template is a first conversion template or a second conversion template, wherein the first conversion template is a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template represents an extensible style sheet language conversion processing template; A fragmentation unit, used for fragmenting the message using the target conversion template to obtain a plurality of message fragments; A second parsing unit, configured to parse the message fragment by using a message parsing strategy matching the message fragment to obtain a parsing result of the message fragment; an aggregation unit, used for aggregating the parsing results of the message fragments to obtain a message of a target version; The device also includes: A calculation unit, used to calculate the weight value of the message according to the target conversion template corresponding to the message, the version information and the size of the message; A policy determination unit, configured to determine a message parsing policy according to the weight value; The message parsing strategies include: current thread parsing strategy, large task slicing parsing strategy and parallel streaming parsing strategy; wherein, The current thread parsing strategy is used to parse messages whose number of nodes is less than a preset number threshold; the parallel streaming parsing strategy is used to parse messages whose size is greater than a preset first threshold and less than a preset second threshold through multiple threads; the large task slicing parsing strategy is used to parse messages whose size is greater than a preset third threshold, and the third threshold is greater than the second threshold.
5. The device according to claim 4, characterized in that The determining unit is specifically used for: Based on the version information, a message translator is obtained, so that the message translator loads a target conversion template based on the interface information of the version information.
6. A storage medium, characterized in that: The storage medium stores executable instructions, which, when executed by a processor, implement the message conversion method according to any one of claims 1 to 3.
7. An electronic device, characterized in that: include: Memory, used to store programs; A processor is used to execute the program, wherein the program is specifically used to: Get the message requested by the user; Parsing the message to obtain version information of the message; Based on the version information, determining a target conversion template, the target conversion template being a first conversion template or a second conversion template, the first conversion template being a template for converting an extensible markup language into a hypertext linking markup language or other types of extensible markup language documents, and the second conversion template representing an extensible style sheet language conversion processing template; Using the target conversion template to fragment the message to obtain a plurality of message fragments; Parsing the message fragment using a message parsing strategy that matches the message fragment to obtain a parsing result of the message fragment; Aggregating the parsing results of the message fragments to obtain a target version of the message; Also used for: calculating the weight value of the message according to the target conversion template corresponding to the message, the version information and the size of the message; Determining a message parsing strategy based on the weight value; The message parsing strategies include: current thread parsing strategy, large task slicing parsing strategy and parallel streaming parsing strategy; wherein, The current thread parsing strategy is used to parse messages whose number of nodes is less than a preset number threshold; the parallel streaming parsing strategy is used to parse messages whose size is greater than a preset first threshold and less than a preset second threshold through multiple threads; the large task slicing parsing strategy is used to parse messages whose size is greater than a preset third threshold, and the third threshold is greater than the second threshold.