Message processing method and system, electronic equipment and computer readable storage medium

In the civil aviation freight search function, the target processing rules are obtained based on the rule database of the target username, and the traffic control and permission verification are carried out, the problem of low accuracy of the traffic limit by the civil aviation freight search function is solved, and accurate traffic limit is achieved.

CN119766739APending Publication Date: 2025-04-04TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411873589.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The civil aviation freight search function has low accuracy in flow restrictions, and no effective solution has been proposed in the existing technology.

Method used

By in response to receiving the freight search instruction, the search request message corresponding to the freight search instruction is determined, and based on the target user name in the request header of the search request message, the target processing rules corresponding to the target user name are obtained from the rule database, and traffic control and permission verification are performed to ensure that only requests that meet the rules can be processed.

Benefits of technology

It achieves accurate traffic restrictions, improves the accuracy of limiting traffic, and solves the problem of low traffic restrictions by civil aviation freight search function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766739A_ABST
    Figure CN119766739A_ABST
Patent Text Reader

Abstract

The invention discloses a message processing method and system, electronic equipment and a computer readable storage medium. The method relates to the field of flow control, and comprises the following steps: in response to a received freight rate search instruction, determining a search request message corresponding to the freight rate search instruction; based on a target user name in a request header of the search request message, a target processing rule corresponding to the target user name is obtained from a rule database, and processing rules corresponding to different user names are stored in the rule database; verifying the search request message based on the target processing rule to obtain a verification result, the verification result being used for representing whether the search request message accords with the target processing rule; and processing the search request message in response to the verification result representing that the search request message accords with the target processing rule. According to the method and the device, the technical problem of relatively low accuracy of traffic limitation of a civil aviation freight rate search function in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of flow control, and in particular to a message processing method, system, electronic device and computer-readable storage medium. Background Art

[0002] With the development of civil aviation technology, the volume of civil aviation business is increasing day by day. In order to improve the convenience of business handling, airlines and airports have gradually developed online channels for various civil aviation businesses, such as civil aviation fare search services. Therefore, it is necessary to accurately control the traffic and permissions of airline users.

[0003] Before and after the civil aviation fare search service is put into use, the machine's traffic load capacity is the basic guarantee to ensure the accuracy and stability of the civil aviation fare search function. At present, the method of manually inputting fare search information and requesting the search server to search for fare is usually adopted. After testing the civil aviation fare search function, it was found that there is still a problem that the civil aviation fare search function has low accuracy in traffic restriction.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present invention provide a message processing method, system, electronic device and computer-readable storage medium to at least solve the technical problem of low accuracy of traffic restriction in the civil aviation fare search function in the related art.

[0006] According to one aspect of an embodiment of the present invention, a message processing method is provided, comprising: in response to receiving a freight rate search instruction, determining a search request message corresponding to the freight rate search instruction; based on a target user name in a request header of the search request message, obtaining a target processing rule corresponding to the target user name from a rule database, wherein the rule database stores processing rules corresponding to different user names; verifying the search request message based on the target processing rule to obtain a verification result, wherein the verification result is used to characterize whether the search request message complies with the target processing rule; and in response to the verification result characterizing that the search request message complies with the target processing rule, processing the search request message.

[0007] Further, the target processing rules include: flow control rules and access permission rules; based on the target processing rules, the search request message is verified to obtain a verification result, including: based on the flow control rules, flow control is performed on the search request message to obtain a flow control result, wherein the flow control result is used to indicate whether the search request message is allowed to be processed; in response to the flow control result indicating that the search request message is allowed to be processed, permission verification is performed on the search request message based on the access permission rules to obtain a permission verification result, wherein the permission verification result is used to indicate whether the search request message is successfully verified; in response to the permission verification result indicating that the search request message is successfully verified, it is determined that the verification result indicates that the search request message complies with the target processing rules; in response to the flow control result indicating that the search request message is not allowed to be processed, or the permission verification result indicating that the search request message verification fails, it is determined that the verification result indicates that the search request message does not comply with the target processing rules.

[0008] Further, the traffic control rules include: a total amount and a sub-amount of different source addresses; based on the traffic control rules, the search request message is subjected to traffic control to obtain a traffic control result, including: determining the target source address corresponding to the search request message; determining whether the traffic of the search request message exceeds the total amount, and whether the traffic of the search request message exceeds the sub-amount of the target source address; in response to the traffic of the search request message not exceeding the total amount, and the traffic of the search request message not exceeding the sub-amount of the target source address, determining that the traffic control result indicates that the search request message is allowed to be processed; in response to the traffic of the search request message exceeding the total amount, or the traffic of the search request message exceeding the sub-amount of the target source address, determining that the traffic control result indicates that the search request message is not allowed to be processed.

[0009] Furthermore, the total amount is determined based on the flow of historical search request messages corresponding to the target user name within a unit time, and the sub-amount of different source addresses is determined based on the flow of historical search request messages corresponding to the target user name within a unit time and containing different source addresses.

[0010] Further, the search request message is subjected to permission verification based on the access permission rules to obtain a permission verification result, including: parsing the search request message to obtain a parsing result; determining whether the parsing result satisfies the access permission rules; in response to the parsing result satisfying the access permission rules, determining that the permission verification result indicates that the search request message verification is successful; in response to the parsing result not satisfying the access permission rules, determining that the permission verification result indicates that the search request message verification has failed.

[0011] Furthermore, in response to the verification result indicating that the search request message does not comply with the target processing rule, the method further includes: releasing resources corresponding to the search request message.

[0012] Furthermore, after processing the search request message, the method also includes: performing traffic statistics on the target user name based on the search request message to obtain the target traffic corresponding to the target user name within a preset time period; in response to the target traffic exceeding the critical traffic, sending an alarm message to the target terminal, wherein the alarm message is used to characterize that the target traffic exceeds the critical traffic.

[0013] According to another aspect of an embodiment of the present invention, there is also provided a message processing system, including: a client, used to send a freight rate search instruction; a verification server, connected to the client, used to determine a search request message corresponding to the freight rate search instruction, based on the target user name in the request header of the search request message, obtaining a target processing rule corresponding to the target user name from a rule database, and verifying the search request message based on the target processing rule to obtain a verification result, wherein the rule database stores processing rules corresponding to different user names, and the verification result is used to characterize whether the search request message complies with the target processing rule; the freight rate search server, connected to the verification server, and used to process the search request message in response to the verification result characterizing that the search request message complies with the target processing rule.

[0014] Further, the verification server includes: a memory for storing target processing rules, wherein the target processing rules include: flow control rules and access permission rules; a flow limiting device for performing flow control on the search request message based on the flow control rules to obtain a flow control result, wherein the flow control result is used to characterize whether the search request message is allowed to be processed; an authority device for performing authority verification on the search request message based on the access permission rules in response to the flow control result characterizing that the search request message is allowed to be processed, to obtain an authority verification result, wherein the authority verification result is used to characterize whether the search request message is successfully verified; wherein, in response to the authority verification result characterizing that the search request message is successfully verified, it is determined that the verification result characterizes that the search request message complies with the target processing rules; in response to the flow control result characterizing that the search request message is not allowed to be processed, or the authority verification result characterizing that the search request message fails to be verified, it is determined that the verification result characterizes that the search request message does not comply with the target processing rules.

[0015] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the method in each embodiment of the present invention is executed when the program is running.

[0016] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.

[0017] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0018] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0019] According to another aspect of the embodiments of the present invention, a computer program is further provided. When the computer program is executed by a processor, the methods in the embodiments of the present invention are implemented.

[0020] In an embodiment of the present invention, in response to receiving a fare search instruction, a search request message corresponding to the fare search instruction is determined; based on the target user name in the request header of the search request message, a target processing rule corresponding to the target user name is obtained from a rule database, wherein the rule database stores processing rules corresponding to different user names; based on the target processing rule, the search request message is verified to obtain a verification result, wherein the verification result is used to characterize whether the search request message complies with the target processing rule; in response to the verification result characterizing that the search request message complies with the target processing rule, the search request message is processed. It is easy to notice that the verification of the search request message based on the target processing rule ensures that only requests that comply with the rules can be processed, thereby achieving the purpose of accurately limiting the flow, thereby achieving the technical effect of being able to limit the flow more accurately, thereby solving the technical problem of low accuracy of flow restriction in the civil aviation fare search function in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0022] Figure 1 is a flow chart of a message processing method according to an embodiment of the present invention;

[0023] Figure 2 It is a process of a method for a configuration center to configure preset rules according to an embodiment of the present invention;

[0024] Figure 3 This is a flow chart of an optional method for controlling the flow of civil aviation user rights at the server according to an embodiment of the present invention;

[0025] Figure 4is a flowchart of an optional token bucket-based message processing method according to an embodiment of the present invention;

[0026] Figure 5 is a schematic diagram of the structure of a configuration table of a configuration management platform according to an embodiment of the present invention;

[0027] Figure 6 is a schematic diagram of an optional search server function according to an embodiment of the present invention;

[0028] Figure 7 is an interactive schematic diagram of an optional message processing method according to an embodiment of the present invention;

[0029] Figure 8 is a schematic diagram of a message processing system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 only 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 should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] Example 1

[0033] According to an embodiment of the present invention, a message processing method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] Figure 1is a flow chart of a message processing method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0035] Step S102: in response to receiving the freight rate search instruction, determining a search request message corresponding to the freight rate search instruction.

[0036] The above-mentioned fare search instruction can be a user who plans to take civil aviation, and can enter it in the search box in the search interface of the client to query the corresponding flight data. Among them, the fare search instruction at least includes: departure place, destination, departure time, ticket price range and civil aviation company name. The above-mentioned search request message can include but is not limited to: civil aviation user name, parsing message, flow calculation and flow control, and access permission restriction.

[0037] In an optional embodiment, in order to solve the technical problem that the accuracy of the civil aviation fare search function for flow restriction in the prior art is low, the embodiment of the present invention proposes a message processing method, which is applied to the server. First, when the search interface of the client receives the fare search data input by the user, first, based on the user's input operation, the fare search data corresponding to the fare search data can be generated, and then the client can send the fare search instruction to the server. When the server receives the fare search instruction, first, based on the preset rules, the search request message corresponding to the fare search instruction can be determined. For example, the parameters of the fare search instruction can be parsed first to obtain the user's query requirements (for example, including but not limited to: departure airport code, destination airport code, departure date, return date (if it is a round-trip ticket), passenger type (adult, child, infant), flight preference (direct flight or transfer), cabin class, airline preference), and then based on the query requirements and the preset rules of the search request message, the search request message corresponding to the fare search instruction can be determined.

[0038] It should be noted that the above preset rules can be set in advance in the configuration center. The configuration center is used to configure the rules for civil aviation users, such as accessible software, whether the message complies with the rules, and whether the traffic exceeds the quota; use the civil aviation user name to bind the user to the rule; search the server to obtain the civil aviation user name in the request header, and use the civil aviation user name to query whether there is a rule for configuring flow control. If there is, access control is performed according to the rules. If not, the process is skipped.

[0039] Figure 2 FIG. 1 is a flow chart of a method for configuring a preset rule in a configuration center according to an embodiment of the present invention. Figure 2 As shown, the method includes:

[0040] Step S21, configuration center rule entry;

[0041] Step S22, airline user name entry;

[0042] Step S23, binding relationship (airline user + rules);

[0043] Step S24, configuration is completed.

[0044] The configuration rules of the configuration center may include but are not limited to: software authorization, application authorization, traffic configuration, and alarm configuration. Table 1 is a schematic table of optional application authorization permissions according to an embodiment of the present invention.

[0045] Table 1

[0046] Is CS function available? Y(Yes) / N(Nno) Is the Reshop function available? Y / N Is the office function available? Y / N Is the near function available? Y / N Is the ticket splitting function available? Y / N Is the Attributeshop feature available? Y / N Maximum number of results Number Types AV Highest Query Level Number Types Search Depth Number Types Number of offices Number Types Number of Segments Number Types Number of brands Number Types Maximum number of days for a one-way calendar search Number Types Maximum number of days to search for round-trip calendar Number Types

[0047] Among them, in the field of civil aviation, CS may refer to Cabin Status or Cabin Seat related functions. Reshop may refer to re-search or re-shopping functions, specifically referring to re-searching or updating search results in the context of civil aviation fare search. The office function usually refers to an internal function used by airlines or travel service providers, which allows users to access and manage their flight reservations, fare information, ticket processing and other services through a specific office or agency code. The near function may refer to an extended function provided by the system in civil aviation fare search or flight query, allowing users to search for information on alternative airports that are "close" to the destination or departure point of a specified route. The Attributeshop function usually refers to an advanced feature in the civil aviation fare search system that allows users to customize and optimize flight query results based on specific attributes or preferences. In the aviation industry, AV stands for Availability, which may specifically refer to the availability query of flight seats. Segment: In air travel, a trip segment (flight segment) refers to a one-way flight from a departure point to a destination.

[0048] Furthermore, the content of the traffic configuration of the configuration center includes: total volume and IP (Internet Protocol Address). Among them, traffic refers to the control of the request frequency or resource consumption of civil aviation users to access the system (such as civil aviation fare search service). IP is used to identify and distinguish the source of network requests issued by different entities. The total volume is calculated based on the transaction volume per second (TPS) of civil aviation users, and the IP is calculated based on the TPS of civil aviation users + source IP.

[0049] Furthermore, the alarm configuration of the configuration center includes: according to daily, monthly and annual statistics, if the traffic is greater than the excess ratio, emails will be sent according to the email addresses filled in by civil aviation users, and excess reminders will be given.

[0050] Furthermore, the content of the input rules of the configuration center includes: binding relationship and unbinding relationship. Among them, the binding relationship includes: selecting a civil aviation user name; selecting a rule to be bound; and performing relationship binding. The unbinding relationship includes: unbinding the association between the civil aviation user and the rule.

[0051] Furthermore, the configuration of the configuration center includes: database update and synchronization cache. The updated data is persistent data, and the synchronization cache uses the civil aviation user name + rule identifier (Identifier, ID) as the rule key to store in a non-relational database (redis). The rule key refers to the key used in redis to store and retrieve data.

[0052] Step S104: based on the target user name in the request header of the search request message, a target processing rule corresponding to the target user name is obtained from a rule database, wherein the rule database stores processing rules corresponding to different user names.

[0053] The target user name may be the target civil aviation user name in the search request message. The target processing rule may be the processing rule corresponding to the target user name. Different rules in the rule database are designed and configured to achieve refined access control and traffic management for the civil aviation fare search service. The rule database may be redis.

[0054] In an optional embodiment, when a search request message is obtained, the server may obtain a target processing rule corresponding to the target user name in redis based on the target user name in the request header of the search request message.

[0055] Step S106, verifying the search request message based on the target processing rule to obtain a verification result, wherein the verification result is used to indicate whether the search request message complies with the target processing rule.

[0056] In an optional embodiment, when the target processing rule corresponding to the request search instruction is obtained, the server can verify the search request message based on the target processing rule to obtain a verification result. For example, the server can compare the parsed request parameters with the attributes and restrictions defined in the target processing rule to verify whether the request complies with the rule. For example, check whether the request attempts to use an unauthorized function or exceeds the defined traffic quota. Verification may also include checking whether the message format is correct and whether the necessary fields are complete and legal, thereby ensuring the quality of the message. Based on the rule matching results, the system will determine whether the user has sufficient authority to perform the function in the request. If the authority is insufficient, the verification result will indicate insufficient authority and may return an error code or message to the client. If the verification passes, that is, the request message complies with all rules, the verification result will indicate that the request is valid, and the search server will continue to process the request, such as performing operations such as freight rate search.

[0057] For another example, the server performs flow control on the search request message based on the flow control rule to obtain a flow control result, wherein the flow control result is used to indicate whether the search request message is allowed to be processed; in response to the flow control result indicating that the search request message is allowed to be processed, the search request message is authorized to be verified based on the access permission rule to obtain a permission verification result, wherein the permission verification result is used to indicate whether the search request message is successfully verified; in response to the permission verification result indicating that the search request message is successfully verified, it is determined that the verification result indicates that the search request message complies with the target processing rule; in response to the flow control result indicating that the search request message is not allowed to be processed, or the permission verification result indicating that the search request message verification fails, it is determined that the verification result indicates that the search request message does not comply with the target processing rule.

[0058] Step S108: In response to the verification result indicating that the search request message complies with the target processing rule, the search request message is processed.

[0059] In an optional embodiment, when it is determined that the verification result shows that the search request instruction complies with the target processing rule, the server may process the search request, for example, the access in the search request instruction may be authorized for subsequent processing.

[0060] In an embodiment of the present invention, in response to receiving a fare search instruction, a search request message corresponding to the fare search instruction is determined; based on the target user name in the request header of the search request message, a target processing rule corresponding to the target user name is obtained from a rule database, wherein the rule database stores processing rules corresponding to different user names; based on the target processing rule, the search request message is verified to obtain a verification result, wherein the verification result is used to characterize whether the search request message complies with the target processing rule; in response to the verification result characterizing that the search request message complies with the target processing rule, the search request message is processed. It is easy to notice that the verification of the search request message based on the target processing rule ensures that only requests that comply with the rules can be processed, thereby achieving the purpose of accurately limiting the flow, thereby achieving the technical effect of being able to limit the flow more accurately, thereby solving the technical problem of low accuracy of flow restriction in the civil aviation fare search function in the related art.

[0061] Optionally, the target processing rules include: flow control rules and access permission rules; verifying the search request message based on the target processing rules to obtain a verification result, including: performing flow control on the search request message based on the flow control rules to obtain a flow control result, wherein the flow control result is used to characterize whether the search request message is allowed to be processed; in response to the flow control result characterizing that the search request message is allowed to be processed, performing permission verification on the search request message based on the access permission rules to obtain a permission verification result, wherein the permission verification result is used to characterize whether the search request message is successfully verified; in response to the permission verification result characterizing that the search request message is successfully verified, determining that the verification result characterizes that the search request message complies with the target processing rules; in response to the flow control result characterizing that the search request message is not allowed to be processed, or the permission verification result characterizing that the search request message fails to be verified, determining that the verification result characterizes that the search request message does not comply with the target processing rules.

[0062] The above-mentioned access permission rules are used to control and manage the access of different civil aviation users to specific software functions or services. This rule system includes multiple dimensions, aiming to ensure the rational use of system resources, data security and fairness of services. Specifically, the access permission rules include the following aspects: software authorization, application function authorization, parameter restrictions, unified rules and exception processing, permission updates and audits, user authentication processes, permission feedback and permission monitoring and alarms. The implementation of access permission rules can significantly improve the security, stability and efficiency of the system. Through the unified management of the configuration center and the real-time verification of the search server, precise control and effective supervision of the access behavior of civil aviation users are achieved, ensuring the rational allocation and utilization of system resources. Table 2 is a schematic table of traffic control rules according to an embodiment of the present invention.

[0063] Table 2

[0064]

[0065] In an optional embodiment, when a target processing rule is obtained, flow control can be performed on the search request message based on the flow control rule to obtain a flow control result, wherein the flow control result is used to indicate whether the search request message is allowed to be processed. When the flow control result indicates that the search request message is allowed to be processed, permission verification is performed on the search request message based on the access permission rule. For example, the search request message can be parsed to obtain a permission verification result, wherein the permission verification result is used to indicate whether the search request message is successfully verified. When the permission verification result indicates that the search request message is successfully verified, it is determined that the verification result indicates that the search request message complies with the target processing rule. When the flow control result indicates that the search request message is not allowed to be processed, or the permission verification result indicates that the search request message verification fails, it is determined that the verification result indicates that the search request message does not comply with the target processing rule.

[0066] Optionally, the flow control rules include: a total amount and a sub-amount of different source addresses; based on the flow control rules, flow control is performed on the search request message to obtain a flow control result, including: determining the target source address corresponding to the search request message; determining whether the flow of the search request message exceeds the total amount, and whether the flow of the search request message exceeds the sub-amount of the target source address; in response to the flow of the search request message not exceeding the total amount, and the flow of the search request message not exceeding the sub-amount of the target source address, determining that the flow control result indicates that the search request message is allowed to be processed; in response to the flow of the search request message exceeding the total amount, or the flow of the search request message exceeds the sub-amount of the target source address, determining that the flow control result indicates that the search request message is not allowed to be processed.

[0067] In an optional embodiment, when a search request message is obtained, the target source address corresponding to the search request message can be determined first, and then it can be determined whether the traffic of the search request message exceeds the total amount, and whether the traffic of the search request message exceeds the sub-amount of the target source address. When it is determined that the traffic of the search request message does not exceed the total amount, and the traffic of the search request message does not exceed the sub-amount of the target source address, it can be determined that the flow control result representation allows the search request message to be processed. When it is determined that the traffic of the search request message exceeds the total amount, or the traffic of the search request message exceeds the sub-amount of the target source address, it can be determined that the flow control result representation does not allow the search request message to be processed.

[0068] Optionally, the total amount is determined based on the flow of historical search request messages corresponding to the target user name within a unit time, and the sub-amounts of different source addresses are determined based on the flow of historical search request messages corresponding to the target user name within a unit time and containing different source addresses.

[0069] In an optional embodiment, the total amount is determined based on the traffic of historical search request messages corresponding to the target user name within a unit time, and the sub-amounts of different source addresses are determined based on the traffic of historical search request messages corresponding to the target user name within a unit time and containing different source addresses.

[0070] Optionally, permission verification is performed on the search request message based on the access permission rules to obtain a permission verification result, including: parsing the search request message to obtain a parsing result; determining whether the parsing result satisfies the access permission rules; in response to the parsing result satisfying the access permission rules, determining that the permission verification result indicates that the search request message verification is successful; in response to the parsing result not satisfying the access permission rules, determining that the permission verification result indicates that the search request message verification has failed.

[0071] In an optional embodiment, the search request message can be first parsed to obtain a parsing result, and a determination can be made as to whether the parsing result satisfies the access permission rules. If the parsing result satisfies the access permission rules, it can be determined that the permission verification result indicates that the search request message verification is successful. If the parsing result does not satisfy the access permission rules, it can be determined that the permission verification result indicates that the search request message verification has failed.

[0072] Optionally, in response to the verification result indicating that the search request message does not comply with the target processing rule, the method further includes: releasing resources corresponding to the search request message.

[0073] In an optional embodiment, when the verification result of the server indicates that the search request message does not comply with the target processing rule, the server may also release the resources corresponding to the search request message.

[0074] Optionally, after processing the search request message, the method also includes: performing traffic statistics on the target user name based on the search request message to obtain the target traffic corresponding to the target user name within a preset time period; in response to the target traffic exceeding the critical traffic, sending an alarm message to the target terminal, wherein the alarm message is used to characterize that the target traffic exceeds the critical traffic.

[0075] The above-mentioned preset time period can be set in advance by a technician and is used to count the traffic of the target username. The specific length of the time period is not limited in this embodiment, and the user can set it according to actual needs.

[0076] In an optional embodiment, the server can also perform traffic statistics on the target user name based on the search request message to obtain the target traffic corresponding to the target user name within a preset time period; in response to the target traffic exceeding the critical traffic, an alarm message is sent to the target terminal, wherein the alarm message is used to characterize that the target traffic exceeds the critical traffic.

[0077] Figure 3 FIG. 1 is a flow chart of an optional method for controlling the flow of civil aviation user rights at the server end according to an embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:

[0078] Step S31, obtaining airline users;

[0079] Step S32, using airline user matching rules;

[0080] Step S33, flow control;

[0081] Step S34, access rights;

[0082] Step S35, the process ends.

[0083] Wherein, obtaining the civil aviation company user includes: obtaining the civil aviation company user name in the request header.

[0084] Among them, the matching rules include: using the user name to obtain the matching rules in redis, jumping out of the process if the rules cannot be obtained, and continuing to access the authorization and current limiting functions if the rules are obtained.

[0085] Among them, access authorization includes: parsing the message to see whether it meets the authorization rules; if it meets the rules, the process continues; if it does not meet the rules, the user is returned with insufficient authorization rights.

[0086] The end of the process includes: release of flow-limited resources and airline user traffic statistics.

[0087] It should be noted that when developing a high-concurrency system, the excess will be rejected, queued or waited, downgraded, etc., and will not occupy resources. It should be noted that when the system's processing capacity cannot cope with the sudden increase in external requests, in order to prevent the system from crashing, current limiting measures must be taken. If the system process is abnormally completed and an exception occurs, resources must be released. Resources cannot be held back, as this will easily lead to system avalanche.

[0088] Current limiting implementation method: Current limiting refers to controlling and regulating the requests in the system to ensure that the system can operate normally when under pressure, and will not cause system downtime or service quality degradation due to a sudden large number of requests. Current limiting plays a vital role in the system, which can smoothly handle request traffic and prevent system overload. Redis: It is a high-performance in-memory database with fast read and write speeds and rich data structure support. In the current limiting scenario, redis can be used as an efficient cache and counting tool to help implement the current limiting function. Performance and atomicity: Lua scripts can atomically execute multiple commands on the redis server side, avoiding the overhead of multiple network communications and improving performance and atomicity. Among them, Lua scripts are a lightweight, high-performance, embeddable scripting language designed to be embedded in applications to provide flexible expansion and automation functions. Lua scripts are usually executed in the Lua virtual machine, which can run directly in an environment that supports Lua. Convenience: Lua scripts can be executed directly on the redis server side without the need to deploy additional runtime environments for other languages, which is more flexible and convenient. Redis support: Redis naturally supports Lua scripts and can be executed directly without additional configuration and plug-ins. Token bucket algorithm: There is a token bucket, and tokens can be added to the bucket. Each token represents a permission to process a request. If a request arrives and there are enough tokens in the bucket, the request is allowed to be processed and the corresponding number of tokens is consumed. If there are not enough tokens in the bucket, the request is rejected or put into a queue waiting for tokens.

[0089] Figure 4 FIG. 1 is a flowchart of an optional token bucket-based message processing method according to an embodiment of the present invention. Figure 4 As shown, the method comprises the following steps:

[0090] Step S41, determine whether there is a request, if so, go to step S42, if not, go to step S47;

[0091] Step S42, obtaining a token;

[0092] Step S43, determine whether the number of tokens is greater than zero, if so, proceed to step S44, if not, proceed to step S46;

[0093] Step S44, processing the request;

[0094] Step S45, consume the token and proceed to step S48;

[0095] Step S46, reject the request and proceed to step S48;

[0096] Step S47, wait, and proceed to step S48;

[0097] Step S48, end.

[0098] The present invention is divided into two parts; the first part: configuration management platform, configuration of access authorization and flow limiting rules, persistence of data, and cache of data; the second part: search server functions, which can be introduced into the project in the form of plug-ins, and the location embodied is the access layer of web page WEB request, that is, the part before processing real business is restricted, and the airline user name is matched with the flow limiting rules to execute flow limiting. Table 3 is a configuration table of an optional configuration management platform according to an embodiment of the present invention.

[0099] Table 3

[0100]

[0101] The implementation principle of the configuration table includes: storing the filled content in the DB (persistent database and non-relational database). Here, MySQL is used for data persistence (1:n). The table structure is as follows Figure 5 As shown. Among them, Figure 5 is a schematic diagram of the structure of a configuration table of a configuration management platform according to an embodiment of the present invention, such as Figure 5 As shown, the structure of the configuration table includes: airline user name, association table and rule table (also called core table). Among them, the airline user name may include but is not limited to: user ID, user name and user email. The association table may include but is not limited to: user ID and rule (i.e. the preset rules mentioned above) ID. The rule table may include but is not limited to: rule ID and rule items. Among them, the airline user name is communicated with the association table for sending data to the association table, and the rule table is also connected to the association table for sending data to the association table.

[0102] The search server functions include: first, the flow limiting system in the access layer can be used to determine whether the airline user corresponding to the request has configured rules. The airline user name can be used to query. If there are rules, perform the following operations. If there are no rules, no authorization or flow restrictions will be made. If there are rules, flow control is first performed. The source IP is obtained through the request, and the flow limit value (total amount and IP limit) is obtained. Redis is used for flow control. If the limit has been exceeded, a prompt is returned to the user, indicating that the airline request has exceeded the limit. If the limit has not been exceeded, the next step is determined.

[0103] The principle of using redis to limit current includes: redis is an in-memory database with very fast read and write speeds. It can handle a large number of requests and return timely responses. It is suitable for current limiting operations in high-concurrency scenarios. Redis supports atomic operations to ensure the accuracy and consistency of the current limiting algorithm. By using redis's counters and time windows and other features, we can quickly and safely perform current limiting operations. Redis usually uses the atomic operations and expiration time features provided by redis to implement current limiting. Here we choose to use Lua scripts and redis commands. The script can atomically check whether the value of the key exceeds the limit, and increase the count or return an error based on the result.

[0104] Next, restrict the software authorization. You can match the queried software authorization by accessing the Uniform Resource Locator (URL). If the software that the target is to access is checked on the management platform, then the following judgment is made. If the software is not checked on the management platform, then the user is fed back: the airline user does not have access to the software. Then apply access restrictions, parse the request message, and compare it with the queried permissions. If an unauthorized function is used, the user is prompted: the user is not granted permission.

[0105] Finally, there is the system alarm function. Each request needs to pass the traffic to the statistics system through the distributed stream processing platform (kafka) and group the traffic of each user. The daily / monthly / yearly boundary values ​​of the user are queried separately. After comparing the statistics, see if the critical traffic is exceeded. If it is exceeded, the statistics system needs to call the mail server to send an email reminder to the user. The statistics system acts as a consumer, which means that you publish each message to a specific topic, and on the other hand, consumers will subscribe to one or more topics and consume the messages therein. The biggest advantage of this decoupled communication is that new services can be added to these events at any time without increasing the complexity of the system or having to change any source code. After subscribing to the traffic content of each airline user, traffic statistics, aggregation, and grouping can be performed. Among them, Kafka is a distributed stream processing platform, commonly used for log processing, message queues, and stream data processing.

[0106] Figure 6 is a schematic diagram of an optional search server function according to an embodiment of the present invention, such as Figure 6As shown, the search server includes: access layer, search engine, management system, DB, redis, kafka, statistics system, and mail server. The access layer includes: current limiting system. The search engine includes: search server. First, the current limiting system in the access layer can be used to limit the search request instruction based on redis. By receiving the current limiting result returned by redis, the request after current limiting can be sent to kafka. Kafka transmits the traffic to the statistics system and groups and counts the traffic of each user. The user's daily / monthly / yearly boundary values ​​are queried separately. After comparing the statistics, see if the critical traffic is exceeded. If exceeded, the statistics system needs to call the mail server to send an email reminder to the user. Among them, redis can obtain the current limiting result through the DB and management system.

[0107] Figure 7 FIG. 1 is an interactive schematic diagram of an optional message processing method according to an embodiment of the present invention. Figure 7 As shown, first, civil aviation user requests can be received through a high-performance HyperText Transfer Protocol (HTTP) and a reverse proxy server (nginx), and the request is sent to the airline user flow limiting platform. Secondly, the airline user flow limiting platform can determine the airline's traffic excess, the airline's software authorization, and the airline's application authorization. If the determination fails, the failure result is sent to the server, and the server analyzes the reasons for the failure, such as traffic excess or insufficient authority. If the determination passes, the search service can search for fares based on the request message through the search server, generate a response message based on the fare search results, and send the response to the airline user flow limiting platform, which transparently transmits the user response result message.

[0108] The present application relates to the field of current limiting technology, including: access layer operation steps and middleware operation steps.

[0109] 1. Access layer operation steps: The airline user flow limiting platform is the core system of the entire invention, which can be deployed and distributed in the middle position between the request and the target system, which is called the access layer. Modify nginx to point to the flow limiting platform. The flow limiting platform relies on the configuration (zookeeper) to the target server IP and URL. The core system here plays the role of controlling traffic, which can control access authorization to traffic and perform user granularity flow limiting (TPS) on traffic. Since the core flow control technology is calculated in an independent cache (here we use redis to maintain the atomicity of data), the invention system supports single-machine or cluster configuration. The response can be determined by the search server. It is recommended to configure a flow limiting platform, which is convenient for the invention to expand the number of search server connections that can be calculated, and can also directly respond to users.

[0110] 2. Middleware operation steps: redis: redis is used here as the cache layer of the application to increase the speed of data access. By storing hot data or frequently accessed data in redis, the number of accesses to the database can be reduced, thereby improving the performance of the application. Here, redis+lua is used to calculate the access traffic of multiple machines and maintain the atomicity of the data. The key-value represents the number of visits by airline users. Kafka: Kafka is selected here as a messaging system for data collection and monitoring. Kafka can quickly publish and subscribe to log file data. It is mainly responsible for the publication of user traffic, and then calculates the usage of user traffic, summarizes and counts it.

[0111] The present invention discloses a flow control method combined with civil aviation user rights. Under the background of localization of information and innovation, the unique identification identifier in the civil aviation user request header is used to configure the user's access rights and flow control, so that the search server can refine the granularity and authority of the flow limit according to the user identity. The characteristics are as follows: 1. It realizes the configuration of different access rights for the civil aviation fare search function for different users; 2. It realizes the configuration of different flow quotas for the civil aviation fare search function for different users, and achieves accurate granular control in real time, refines the dimensions, and reduces the manual workload and improves the flexibility of the system through page management configuration. Among them, the deployment and use of high adaptation, cross-platform feature deployment and startup can reflect multi-activity, and high adaptation supports the localization of servers, applications, and databases, which improves the high scalability and flexibility of the system. In view of the above problems, this application is proposed in combination with the background of localization of information and innovation to provide a flow control method, device and system combined with civil aviation user rights to realize the task of the civil aviation fare search function according to the flow control of civil aviation users.

[0112] The core innovations include: This is a set of integrated solutions that are more suitable for airline user flow control, authentication, early warning, and monitoring. The flow control feature is close to the fine-grained flow control of civil aviation business. Different from the traditional flow control (according to the server, cluster, interface), this patent provides flow control according to the dimension of civil aviation users, and can also use the control means for the flow allocation of different airline users, supporting the superposition of traditional flow control methods for secondary flow control. Message permission control, parsing the key nodes of the message, controlling and judging the attributes of the airline request, can be expanded to set access authorization for each airline user, such as the maximum number of offices supported by the user, whether the user has the right to perform the cs split function, and split according to the fine-grained split of airline users, personalized permissions for each user. The technical innovation point is biased towards flow monitoring after flow limiting. This patent uses Kafka (which can be replaced by other distributed message queue middleware, such as RabbitMQ, ActiveMQ, RocketMQ, etc.) to collect data and connect to the monitoring data source, depicting the flow restriction or permission control of a certain airline, and more intuitively observing the flow changes of the airline you want to observe.

[0113] According to another aspect of an embodiment of the present invention, a message processing system is provided. Figure 8 is a schematic diagram of a message processing system according to an embodiment of the present invention. Figure 8 As shown, the system 80 includes: a client 82, a verification server 84 and a freight rate search server 86. Figure 8 As shown, the verification server 84 is connected in communication with the client 82 , and the freight rate search server 86 is connected in communication with the verification server 84 .

[0114] The client is used to send a freight rate search instruction; the verification server is used to determine the search request message corresponding to the freight rate search instruction, obtain the target processing rule corresponding to the target user name from the rule database based on the target user name in the request header of the search request message, and verify the search request message based on the target processing rule to obtain a verification result, wherein the rule database stores processing rules corresponding to different user names, and the verification result is used to indicate whether the search request message complies with the target processing rule; the freight rate search server is used to process the search request message in response to the verification result indicating that the search request message complies with the target processing rule.

[0115] Further, the verification server includes: a memory for storing target processing rules, wherein the target processing rules include: flow control rules and access permission rules; a flow limiting device for performing flow control on the search request message based on the flow control rules to obtain a flow control result, wherein the flow control result is used to characterize whether the search request message is allowed to be processed; an authority device for performing authority verification on the search request message based on the access permission rules in response to the flow control result characterizing that the search request message is allowed to be processed, to obtain an authority verification result, wherein the authority verification result is used to characterize whether the search request message is successfully verified; wherein, in response to the authority verification result characterizing that the search request message is successfully verified, it is determined that the verification result characterizes that the search request message complies with the target processing rules; in response to the flow control result characterizing that the search request message is not allowed to be processed, or the authority verification result characterizing that the search request message fails to be verified, it is determined that the verification result characterizes that the search request message does not comply with the target processing rules.

[0116] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention when running.

[0117] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.

[0118] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.

[0119] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0120] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.

[0121] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0122] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0123] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0124] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0125] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0126] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0127] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A message processing method, characterized in that: include: In response to receiving a freight rate search instruction, determining a search request message corresponding to the freight rate search instruction; Based on the target user name in the request header of the search request message, obtaining a target processing rule corresponding to the target user name from a rule database, wherein the rule database stores processing rules corresponding to different user names; Verifying the search request message based on the target processing rule to obtain a verification result, wherein the verification result is used to indicate whether the search request message complies with the target processing rule; In response to the verification result indicating that the search request message complies with the target processing rule, the search request message is processed.

2. The method according to claim 1, characterized in that: The target processing rules include: flow control rules and access permission rules; based on the target processing rules, the search request message is verified to obtain a verification result, including: Performing flow control on the search request message based on the flow control rule to obtain a flow control result, wherein the flow control result is used to indicate whether the search request message is allowed to be processed; In response to the flow control result indicating that the search request message is allowed to be processed, performing permission verification on the search request message based on the access permission rule to obtain a permission verification result, wherein the permission verification result is used to indicate whether the search request message is successfully verified; In response to the authority verification result indicating that the search request message is successfully verified, determining that the verification result indicates that the search request message complies with the target processing rule; In response to the flow control result indicating that the search request message is not allowed to be processed, or the authority verification result indicating that the search request message fails verification, it is determined that the verification result indicates that the search request message does not comply with the target processing rule.

3. The method according to claim 2, characterized in that The flow control rule includes: a total amount and sub-amounts of different source addresses; based on the flow control rule, flow control is performed on the search request message to obtain a flow control result, including: Determine the target source address corresponding to the search request message; Determining whether the flow of the search request message exceeds the total amount, and whether the flow of the search request message exceeds the sub-amount of the target source address; In response to the flow of the search request message not exceeding the total amount and the flow of the search request message not exceeding the sub-amount of the target source address, determining that the flow control result indicates that the search request message is allowed to be processed; In response to the flow of the search request message exceeding the total amount, or the flow of the search request message exceeding the sub-amount of the target source address, determining that the flow control result indicates that the search request message is not allowed to be processed.

4. The method according to claim 3, characterized in that The total amount is determined based on the flow of historical search request messages corresponding to the target user name within a unit time, and the sub-amount of different source addresses is determined based on the flow of historical search request messages corresponding to the target user name within a unit time, including the different source addresses.

5. The method according to claim 2, characterized in that: Performing permission verification on the search request message based on the access permission rule to obtain a permission verification result includes: Parsing the search request message to obtain a parsing result; Determining whether the parsing result satisfies the access permission rule; In response to the parsing result satisfying the access permission rule, determining that the permission verification result indicates that the search request message has been successfully verified; In response to the parsing result not satisfying the access permission rule, it is determined that the permission verification result indicates that the search request message has failed verification.

6. The method according to any one of claims 1 to 5, characterized in that In response to the verification result indicating that the search request message does not comply with the target processing rule, the method further includes: The resources corresponding to the search request message are released.

7. The method according to any one of claims 1 to 5, characterized in that After processing the search request message, the method further includes: Performing traffic statistics on the target user name based on the search request message to obtain the target traffic corresponding to the target user name within a preset time period; In response to the target flow exceeding the critical flow, an alarm message is sent to the target terminal, wherein the alarm message is used to indicate that the target flow exceeds the critical flow.

8. A message processing system, characterized in that: include: Client, used to send freight rate search instructions; a verification server connected to the client, used to determine the search request message corresponding to the freight rate search instruction, obtain the target processing rule corresponding to the target user name from a rule database based on the target user name in the request header of the search request message, and verify the search request message based on the target processing rule to obtain a verification result, wherein the rule database stores processing rules corresponding to different user names, and the verification result is used to indicate whether the search request message complies with the target processing rule; The freight rate search server is connected to the verification server and is used to process the search request message in response to the verification result indicating that the search request message complies with the target processing rule.

9. The system according to claim 8, characterized in that The verification server comprises: A memory, used to store the target processing rules, wherein the target processing rules include: flow control rules and access permission rules; A flow limiting device, used for performing flow control on the search request message based on the flow control rule to obtain a flow control result, wherein the flow control result is used to indicate whether the search request message is allowed to be processed; an authority device, configured to perform authority verification on the search request message based on the access permission rule in response to the flow control result indicating that the search request message is allowed to be processed, and obtain an authority verification result, wherein the authority verification result is used to indicate whether the search request message is successfully verified; Among them, in response to the authority verification result indicating that the search request message is successfully verified, it is determined that the verification result indicates that the search request message complies with the target processing rule; in response to the flow control result indicating that processing of the search request message is not allowed, or the authority verification result indicating that the search request message fails to be verified, it is determined that the verification result indicates that the search request message does not comply with the target processing rule.

10. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 7 when running.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 7.

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