A method, device and medium for converting an HTTP protocol and a Dubbo protocol
By using an automated method to convert between the HTTP and Dubbo protocols, the problems of protocol conversion and field mapping during business system migration were solved, achieving data accuracy and flexible gray-scale control, and reducing maintenance costs and business interruption risks.
Patent Information
- Application Number
- CN202611520549.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-11-27
AI Technical Summary
During the migration of business systems, existing technical solutions cannot effectively handle the automatic conversion and field mapping between the HTTP protocol and the Dubbo protocol, resulting in inaccurate business data and high maintenance costs during the migration process.
By acquiring configuration information, automatic bidirectional conversion between the HTTP protocol and the Dubbo protocol is achieved, including field mapping rules and traffic scheduling strategies. It supports field name mapping, data type conversion, and custom conversion logic. It uses dynamic traffic scheduling strategies and asynchronous collection of response data for consistency comparison and generates difference reports to monitor migration quality.
It achieves automatic bidirectional conversion between HTTP and Dubbo protocols, reducing maintenance costs, ensuring the accuracy and integrity of business data, reducing the risk of business interruption during full-scale switching, and providing flexible canary control and self-protection capabilities.
Smart Images

Figure CN123185281A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for converting between the HTTP protocol and the Dubbo protocol. Background Technology
[0002] During the iteration of business systems, it is a common requirement to migrate client interfaces from the original business architecture to a unified business orchestration layer. However, due to significant differences between the old and new systems in terms of communication protocols, data formats, and field definitions, the migration process faces many technical challenges.
[0003] Currently, the existing technologies mainly adopt the following two solutions for this type of interface migration scenario: I. Static Forwarding Solution: This solution configures URL mapping through gateway tools such as Nginx to forward client requests to both the old and new interfaces. Its drawback is that it only supports simple URL-level request forwarding and cannot handle protocol conversions or field mappings.
[0004] II. Hard-coded Conversion Solution: This solution implements the conversion of old and new interface fields programmatically within the business code. Its drawbacks are: the conversion logic is coupled with the business code, requiring recompilation and redeployment for any changes to the field mapping rules; and the field mapping rules are scattered across various business code sections, leading to a sharp increase in maintenance costs when there are a large number of interfaces.
[0005] In summary, existing technical solutions have significant shortcomings in terms of automatic protocol conversion and unified management of field mapping. Summary of the Invention
[0006] To address the problems in the prior art, embodiments of this application provide a method, apparatus, device, and medium for converting between HTTP and Dubbo protocols, used to achieve automatic bidirectional conversion between HTTP and Dubbo protocols during the migration of a business system to a business orchestration layer architecture, so as to ensure the accuracy and integrity of business data during the migration process.
[0007] In a first aspect, embodiments of this application provide a method for converting between the HTTP protocol and the Dubbo protocol, including: Obtain configuration information, which includes the mapping relationship and field mapping rules between the HTTP interface and the Dubbo interface; Receive HTTP requests forwarded by the gateway and sent by the client; The HTTP protocol parameters of the HTTP request are converted into Dubbo protocol parameters according to the field mapping rules. The converted Dubbo protocol parameters are serialized to generate a call request that conforms to the Dubbo protocol format; The call request is sent to the Dubbo interface according to the mapping relationship, and the Dubbo response returned by the Dubbo interface is received. The Dubbo response is deserialized, and the deserialized Dubbo response is converted into an HTTP response according to the field mapping rules. The HTTP response is returned to the gateway, which then returns the HTTP response to the client.
[0008] Through the synergistic effect of each step, this application produces the following beneficial effects: 1. Implement automatic bidirectional conversion between HTTP protocol and Dubbo protocol.
[0009] This solution constructs a complete bidirectional conversion link by performing input parameter conversion, serializing and sending Dubbo requests and receiving responses, deserializing and converting output parameters through the business orchestration layer. It solves the problem that static forwarding solutions in the existing technology cannot handle protocol conversion, enabling clients to seamlessly call Dubbo services without being aware of backend protocol changes.
[0010] Second, implement configurable field mapping to reduce maintenance costs.
[0011] This solution obtains field mapping rules and automatically completes field conversion based on those rules, decoupling the mapping logic from the business code. This solves the problems of hard-coded field mapping in existing technologies, which require redeployment for modifications and make rules scattered and difficult to maintain.
[0012] In one possible implementation, the field mapping rule includes at least one of field name mapping, data type conversion, and custom conversion logic.
[0013] In the above implementation, the field mapping rule uses field name mapping to automatically match field names in the HTTP interface and Dubbo interface (e.g., "driver_id" maps to "driverId"), solving the problems of error-prone and inefficient manual mapping. It also employs data type conversion to support automatic conversion between different data types (e.g., converting a string timestamp to a date format), avoiding call failures due to type mismatches. Furthermore, it uses custom conversion logic to support complex business conversion requirements (e.g., field concatenation, encryption), flexibly adapting to various migration scenarios. These three rules can be used individually or in combination, further improving the flexibility and applicability of field mapping.
[0014] In one possible implementation, the HTTP request is routed by the gateway to the service orchestration layer according to a dynamic traffic scheduling strategy.
[0015] In the above implementation, the gateway uses a dynamic traffic scheduling strategy to route HTTP requests to the business orchestration layer, so that traffic allocation is no longer a static, fixed ratio, but can be dynamically adjusted according to the real-time operating status. Compared with existing technologies such as Nginx, which only support static weight configuration, this solution introduces flexibility in the traffic routing stage, providing a foundation for subsequent canary releases, canary volume scaling, and fault self-healing, effectively reducing the risk of business interruption caused by full-scale switching.
[0016] In one possible implementation, the traffic scheduling strategy includes at least one of the following strategies: a ratio-based strategy, a whitelist-based strategy, a business attribute-based strategy, a time window-based strategy, and a combination of the above strategies.
[0017] The above implementation methods include traffic scheduling strategies such as: a percentage-based strategy, which supports gradual increase in volume by percentage (e.g., from 10% to 100%) for smooth migration; a whitelist-based strategy, which allows designated test accounts or internal users to prioritize the use of the Dubbo interface, verifying the correctness of the new link in advance under real business scenarios; a business attribute-based strategy, which supports fine-grained control of the gray-scale range by business dimensions such as city and driver level, making the migration strategy more aligned with business needs; and a time window-based strategy, which supports automatically increasing the volume ratio during off-peak periods and automatically decreasing it during peak periods, minimizing the impact on business. Multiple strategies can be combined to form a multi-dimensional, multi-layered gray-scale control system.
[0018] In one possible implementation, after returning the HTTP response to the gateway, the method further includes: The HTTP response is collected asynchronously, and the collected HTTP response is reported to the log center as data to be verified, so as to compare its consistency with the response data directly returned by the HTTP interface.
[0019] In the above implementation, the HTTP response is asynchronously collected after being returned to the gateway and reported to the log center, thus achieving automatic recording of the transformation results of the business orchestration layer. The asynchronous collection method does not affect the real-time performance of the response return; that is, the collection process does not block the main business process, ensuring the normal response speed of the client APP. The collected HTTP response serves as data to be verified and is compared for consistency with the response data directly returned by the HTTP interface, providing a data foundation for full data verification and solving the problems of low coverage and inability to detect inconsistencies in fields across all requests caused by manual sampling.
[0020] In one possible implementation, the consistency comparison includes field-level comparison, which includes checking at least one of the following comparison dimensions: field existence, field value consistency, and data type compatibility.
[0021] In the above implementation, field-level comparison includes checking field existence to detect whether the new interface response is missing a field that existed in the old interface (e.g., the HTTP interface returns "driver_id" but the Dubbo interface is missing this field after conversion), avoiding client parsing failure due to field omissions; checking field value consistency to detect whether the same field has the same value in the HTTP and Dubbo responses (e.g., whether "order_no" is "OD001" in both), ensuring the accuracy of business data; and checking data type compatibility to detect whether data types are compatible (e.g., the HTTP interface shows the string "123", while the Dubbo interface converts it to the integer 123, which is considered compatible) or have type errors (e.g., the string "abc" is converted to an integer, causing failure). These three comparison dimensions ensure the integrity and accuracy of business data during the migration process from different levels.
[0022] In one possible implementation, the result of the consistency comparison is used to generate a difference report, which is used to trigger an alarm when the difference rate exceeds a first preset threshold.
[0023] In the above implementation, the consistency comparison results are used to generate a discrepancy report. This report contains detailed information such as the inconsistent field names, specific values, and inconsistency types (missing / value deviation / type error), providing a basis for operations and maintenance personnel to locate problems. An alarm is triggered when the discrepancy rate exceeds a first preset threshold, achieving automatic monitoring of migration quality and enabling timely detection of issues without manual inspection. After operations and maintenance personnel locate and fix the cause of the problem based on the discrepancy report (such as incorrect field mapping, abnormal Dubbo interface return, etc.), they can initiate a test request through a whitelisted driver to verify the issue. Only after confirming the problem is resolved can the migration process continue, forming a complete quality assurance closed loop of "discovery-location-fixing-verification".
[0024] In one possible implementation, the traffic scheduling policy includes a whitelist policy; and before the gateway performs routing according to the traffic scheduling policy, it further includes: Obtain the source identifier of the HTTP request returned by the gateway; When the source identifier matches the target identifier recorded in the whitelist policy, a forced routing instruction is sent to the gateway so that the gateway routes the HTTP request carrying the target identifier to the service orchestration layer.
[0025] In the above implementation, the traffic scheduling strategy includes a whitelist strategy. The business orchestration layer obtains the source identifier (such as driver ID, device ID, or user account) of the HTTP request returned by the gateway. When the source identifier matches the target identifier recorded in the whitelist strategy, a forced routing instruction is sent to the gateway, causing the gateway to route the HTTP request carrying the target identifier to the business orchestration layer. Since the source identifiers in the whitelist usually correspond to internal testers or specific verification scenarios, this mechanism ensures that specific test requests always hit the Dubbo interface link without affecting real online users. This is used for new interface function verification during the migration preparation phase, regression verification after problem fixing during the migration process, and final acceptance testing before deployment. The whitelist strategy works in conjunction with the proportion-based strategy—the whitelist strategy has higher priority than the proportion strategy, ensuring that specific test requests are not limited by the volume scaling ratio, providing a controllable testing and verification method for the entire migration process.
[0026] In one possible implementation, after asynchronously capturing the HTTP response, the following is also included: The real-time operating metrics of the service orchestration layer are periodically acquired, and the real-time operating metrics include at least one of the service success rate and response time of the service orchestration layer. When the service success rate is lower than the second preset threshold and / or the response time is lower than the third preset threshold, a policy adjustment instruction is sent to the configuration center so that the configuration center reduces the traffic allocation ratio in the traffic scheduling policy.
[0027] In the above implementation, after asynchronously collecting HTTP responses, the business orchestration layer periodically obtains its own real-time operational metrics (service success rate, response time). When the service success rate falls below a second preset threshold and / or the response time falls below a third preset threshold, it proactively sends a policy adjustment instruction to the configuration center to reduce the volume scaling ratio. During the migration process, if the new interface of the business orchestration layer has code defects, performance bottlenecks, or abnormal dependent services, this mechanism can automatically detect and trigger protective degradation, switching traffic back to the HTTP interface to prevent the fault from escalating, thus achieving the system's self-protection capability.
[0028] Secondly, embodiments of this application provide an apparatus for converting between the HTTP protocol and the Dubbo protocol, the apparatus comprising: The parameter conversion unit is used to obtain configuration information, including the mapping relationship and field mapping rules between the HTTP interface and the Dubbo interface; receive HTTP requests forwarded by the gateway and sent by the client; and convert the HTTP protocol parameters of the HTTP request into Dubbo protocol parameters according to the field mapping rules. The response receiving unit is used to serialize the converted Dubbo protocol parameters to generate a call request that conforms to the Dubbo protocol format; send the call request to the Dubbo interface according to the mapping relationship; and receive the Dubbo response returned by the Dubbo interface. The protocol conversion unit is used to deserialize the Dubbo response and convert the deserialized Dubbo response into an HTTP response according to the field mapping rules; and return the HTTP response to the gateway so that the gateway can return the HTTP response to the client.
[0029] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and when the computer program is executed by the processor, it implements the method described in any one of the HTTP protocol and Dubbo protocol conversion methods of the first aspect.
[0030] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in any one of the HTTP protocol and Dubbo protocol conversion methods of the first aspect.
[0031] The beneficial effects that the technical solutions in the second to fourth aspects can achieve are the same as those in the first aspect, and will not be repeated here. Attached Figure Description
[0032] Figure 1 A flowchart illustrating a method for converting between HTTP and Dubbo protocols provided in this application embodiment; Figure 2 A schematic diagram of the structure of an HTTP protocol to Dubbo protocol conversion device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0034] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.
[0035] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that in the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0036] The acquisition, transmission, storage, and use of data in this application all comply with relevant national laws and regulations.
[0037] Before introducing the HTTP protocol and Dubbo protocol conversion method provided in the embodiments of this application, the technical background of the embodiments of this application will be described in detail below for ease of understanding.
[0038] During the iteration of business systems, it is a common requirement to migrate client interfaces from the original business architecture to a unified business orchestration layer. However, due to significant differences between the old and new systems in terms of communication protocols, data formats, and field definitions, the migration process faces many technical challenges.
[0039] Currently, the existing technologies mainly adopt the following two solutions for this type of interface migration scenario: I. Static Forwarding Solution: This solution configures URL mapping through gateway tools such as Nginx to forward client requests to both the old and new interfaces. Its drawback is that it only supports simple URL-level request forwarding and cannot handle protocol conversions or field mappings.
[0040] II. Hard-coded Conversion Solution: This solution implements the conversion of old and new interface fields programmatically within the business code. Its drawbacks are: the conversion logic is coupled with the business code, requiring recompilation and redeployment for any changes to the mapping rules; and the field mapping rules are scattered across various business code sections, leading to a sharp increase in maintenance costs when there are a large number of interfaces.
[0041] In summary, existing technical solutions have significant shortcomings in terms of automatic protocol conversion and unified management of field mapping.
[0042] The following is combined Figure 1 This application describes a method for converting between the HTTP protocol and the Dubbo protocol according to an embodiment of the present application.
[0043] refer to Figure 1 , Figure 1 An exemplary embodiment of this application provides a method for converting between the HTTP protocol and the Dubbo protocol, the method comprising the following steps: Step S101: Obtain configuration information.
[0044] The configuration information includes the mapping relationship between the HTTP interface and the Dubbo interface, as well as the field mapping rules.
[0045] Specifically, during the migration preparation phase, R&D personnel complete the following configurations through the configuration management module: I. Mapping relationship between HTTP interface and Dubbo interface.
[0046] Developers input the URL mapping between HTTP interfaces and Dubbo interfaces. For example, mapping the HTTP interface " / driver / order / create" to the Dubbo interface " / orchestration / driver / order / create" instructs the business orchestration layer which Dubbo interface to call when it receives an HTTP request for that path. The mapping supports one-to-one mapping as well as many-to-one mapping (multiple HTTP interfaces corresponding to different methods of the same Dubbo interface).
[0047] II. Field mapping rules.
[0048] Developers input field mapping rules according to the interface, including but not limited to: field name mapping (e.g., the HTTP interface field "driver_id" corresponds to the Dubbo interface field "driverId"), data type conversion (e.g., the HTTP interface field "create_t" is a string timestamp, which is converted to the date and time format of the Dubbo interface field "createTime"), and custom conversion logic.
[0049] Field mapping rules are stored in the field mapping system, and the business orchestration layer retrieves these rules by calling the interfaces provided by the field mapping system. The field mapping system supports hot updates, meaning that changes to the mapping rules take effect without requiring a service restart.
[0050] III. Initial Traffic Scheduling Strategy.
[0051] The R&D personnel configure the initial traffic scheduling strategy, such as "100% traffic to the HTTP interface", and at the same time enable the traffic replay function - that is, copy a real business request and send it to the Dubbo interface of the business orchestration layer for verification, but the response is not returned to the client, but only used to collect data for consistency comparison.
[0052] IV. Verification threshold.
[0053] R&D personnel set monitoring parameters such as the difference rate threshold for consistency comparison (e.g., "trigger an alarm if the difference rate exceeds 1%)" and the success rate threshold for Dubbo interface (e.g., "trigger an alarm if the success rate is below 99.9%)".
[0054] V. SDK Deployment.
[0055] The developers deployed the protocol consistency verification module SDK at both the original business HTTP interface and the business orchestration layer Dubbo interface, configured the SDK's log reporting address (such as SLS log service), and enabled the response interception function. Before the service returns a response after processing the request, the SDK asynchronously intercepts and copies a copy of the response data (including request parameters, response content, traceId, timestamp, etc.), without affecting the normal business response return.
[0056] Step S102: Receive the HTTP request sent by the client and forwarded by the gateway.
[0057] Specifically, the client (such as the driver's app) initiates an HTTP request, such as a "create order" request: POST / driver / order / create, with the request body being {"driver_id":123, "order_no":"OD001", "create_t":1693526400000}.
[0058] The smart gateway receives the HTTP request and executes the following routing logic: 1. URL matching.
[0059] The gateway queries the URL mapping relationship stored in the configuration center based on the request URL (such as / driver / order / create) to determine the corresponding Dubbo interface (such as / orchestration / driver / order / create) for the request.
[0060] II. Traffic Strategy Inquiry.
[0061] The gateway invokes the dynamic traffic scheduling module to determine where the request should be routed based on the currently configured traffic scheduling policy. The traffic scheduling policy is dynamically adjustable; the configuration center stores and manages the policy, and the gateway pulls the latest policy in real time, which takes effect without requiring a restart.
[0062] III. Routing Decisions.
[0063] The gateway executes the route based on the policy determination result: If the volume release condition is not met (e.g., the current volume release ratio is 10%, and the request does not fall within the volume release range): the gateway will forward the request to the HTTP interface (the original business HTTP interface), which will process it directly and return a response. In this case, there is no protocol conversion by the business orchestration layer.
[0064] If the volume release condition is met (e.g., the request falls within the 10% volume release range, or the request comes from a whitelisted driver): the gateway will forward the request to the business orchestration layer, which will then execute the subsequent protocol conversion process.
[0065] Step S103: Convert the HTTP protocol parameters of the HTTP request into Dubbo protocol parameters according to the field mapping rules.
[0066] Specifically, after the business orchestration layer receives the HTTP request forwarded by the gateway, it performs input parameter transformation: 1. Parsing HTTP request parameters.
[0067] The business orchestration layer extracts request body parameters from the HTTP request, such as {"driver_id":123, "order_no":"OD001", "create_t":1693526400000}.
[0068] 2. Call the field mapping system.
[0069] The business orchestration layer calls the interface provided by the field mapping system based on the identifier of the current interface (e.g., / driver / order / create) to obtain the field mapping rules corresponding to that interface. For example, the following mapping rules are obtained: (1) driver_id → driverId (field name mapping, direct mapping); (2) order_no → orderId (field name mapping, direct mapping); (3) create_t → createTime(field name mapping + data type conversion: timestamp to date and time string, conversion function is timestampToStr) 3. Perform field conversion.
[0070] The business orchestration layer converts the HTTP protocol parameters field by field into Dubbo protocol parameters according to the mapping rules, resulting in the Dubbo protocol parameters: {"driverId":123, "orderId":"OD001", "createTime":"2024-09-0110:00:00"}. For older fields not defined in the mapping rules, they are handled according to the default rules (e.g., directly passed through or ignored, depending on the configuration); for fields requiring custom conversion logic, the corresponding conversion function is called for processing.
[0071] IV. Parameter Verification.
[0072] After the conversion is complete, the business orchestration layer validates the converted Dubbo protocol parameters, such as checking whether the driverId is not empty and whether the orderId matches the format requirements (e.g., "OD + number"). If the validation passes, it proceeds to the next step; if the validation fails, it directly returns an error response to the gateway and does not continue with subsequent steps.
[0073] Step S104: Serialize the converted Dubbo protocol parameters to generate a call request that conforms to the Dubbo protocol format.
[0074] Specifically, the business orchestration layer performs a forward conversion of the protocol adaptation: 1. Construct the Dubbo call request object.
[0075] The business orchestration layer maps the converted Dubbo protocol parameters (JSON format) to the Java objects required by the Dubbo service interface. For example, {"driverId":123, "orderId":"OD001", "createTime":"2024-09-0110:00:00"} is constructed as an OrderCreateRequest object, which contains three properties: driverId (integer type), orderId (string type), and createTime (LocalDateTime type).
[0076] II. Serialization.
[0077] The business orchestration layer uses Hessian2 serialization to serialize Java objects into binary data conforming to the Dubbo protocol format, generating Dubbo call requests. Hessian2 is the serialization protocol supported by default in the Dubbo framework, featuring small serialized data size, good cross-language support, and high serialization / deserialization performance, making it suitable for high-concurrency RPC call scenarios.
[0078] III. Set the calling parameters.
[0079] The business orchestration layer sets relevant parameters for Dubbo calls, including: the name of the service interface to be called (e.g., com.driver.service.OrderService), the method name (e.g., create), the timeout (e.g., 3000ms), and the retry strategy (e.g., retry once after failure).
[0080] Step S105: Send the call request to the Dubbo interface according to the mapping relationship, and receive the Dubbo response returned by the Dubbo interface.
[0081] Specifically, the business orchestration layer executes Dubbo service calls: I. Service discovery and load balancing.
[0082] The business orchestration layer acts as a Dubbo Consumer, obtaining a list of instances of the original business Dubbo service (Dubbo Provider) from the service registry (such as Nacos or Zookeeper), and selecting an instance to initiate a call based on the configured load balancing strategy (such as weighted random, least active calls, etc.).
[0083] 2. Send the call request.
[0084] Based on the mapping relationship between the HTTP interface and the Dubbo interface obtained in step S101, the business orchestration layer sends the serialized Dubbo call request to the selected original business Dubbo service instance via the network.
[0085] For example, send the request to com.driver.service.OrderService#create.
[0086] 3. Receive Dubbo response.
[0087] The original business-side Dubbo service receives requests and executes business logic (such as creating orders, writing to the database, etc.), generates a Dubbo response, and returns it to the business orchestration layer. The business orchestration layer receives the Dubbo response, for example, receiving OrderCreateResponse(code=0, msg="success", data=OrderData(driverId=123,orderId="OD001")). IV. Timeout and Exception Handling
[0088] If the call times out (exceeding the 3000ms set in step S104), the service orchestration layer throws a timeout exception and decides whether to retry based on the configured retry policy. If the retry still fails, an error response is returned to the gateway, which marks the request as failed and triggers degradation logic (such as switching traffic back to the HTTP interface).
[0089] Step S106: Deserialize the Dubbo response and convert the deserialized Dubbo response into an HTTP response according to the field mapping rules.
[0090] Specifically, the business orchestration layer performs protocol adaptation reverse conversion and output parameter conversion: 1. Deserialization.
[0091] After receiving the Dubbo response, the business orchestration layer uses Hessian2 deserialization to deserialize the binary response data in Dubbo protocol format into a Java object, such as an OrderCreateResponse object. This object contains three attributes: code (integer), msg (string), and data (OrderData object). The OrderData object contains driverId (integer) and orderId (string).
[0092] 2. Convert to Dubbo protocol response.
[0093] The business orchestration layer converts the deserialized Java object into a Dubbo protocol JSON response, which is then used to obtain the Dubbo protocol response. The Dubbo protocol response adopts the same naming convention as the fields returned by the Dubbo interface (such as driverId, orderId).
[0094] III. Parameter conversion.
[0095] The business orchestration layer calls the field mapping system again to obtain the field mapping rules for the output parameters, converting the Dubbo protocol response into an HTTP protocol response. The conversion rules are the opposite of the input parameter conversion: driverId → driver_id, orderId → order_no. The converted response is then an HTTP protocol response.
[0096] IV. Add default fields.
[0097] If the HTTP response needs to include fields specific to the HTTP interface (such as the HTTP interface returning a timestamp field while the Dubbo interface does not), the business orchestration layer will automatically supplement the default values according to the configuration (such as automatically adding "timestamp":1693526401000) to ensure that the field integrity of the HTTP response is consistent with that of the HTTP interface.
[0098] Step S107: Return the HTTP response to the gateway so that the gateway can return the HTTP response to the client.
[0099] Specifically, after the business orchestration layer completes the protocol conversion, it returns the converted HTTP response to the smart gateway, and simultaneously outputs an HTTP response log asynchronously and reports it to the log center. Upon receiving the HTTP response, the smart gateway forwards it unchanged to the client (driver's app). The response format received by the client is completely consistent with when directly calling the original business's HTTP interface before the migration, achieving a seamless migration for the client.
[0100] In one possible implementation, the traffic scheduling strategy of this application embodiment includes at least one of the following: a ratio-based strategy, a whitelist-based strategy, a service attribute-based strategy, and a time window-based strategy, as well as a combination of the above strategies. The specific implementation methods of each strategy are described in detail below.
[0101] I. Proportion-based strategies.
[0102] A percentage-based strategy involves distributing client requests to either the business orchestration layer (new interface) or the HTTP interface (old interface) according to a preset percentage. This strategy is the most basic traffic control method during canary migration.
[0103] Specifically, developers set the scaling ratio in the configuration center, for example, to 10%, meaning that 10% of requests will be routed to the business orchestration layer and 90% will be routed to the HTTP interface. After receiving a client request, the gateway performs a hash calculation on the request's identifier information (such as request ID, client ID, or user ID), and takes the hash value modulo 100. If the modulo result is less than the scaling ratio, the request is routed to the business orchestration layer; otherwise, it is routed to the HTTP interface. This hash modulo method ensures that requests from the same user are always routed to the same target while maintaining the same scaling ratio, avoiding data inconsistencies or user experience fluctuations caused by the same user repeatedly switching between the HTTP and Dubbo interfaces during migration.
[0104] The scaling ratio can be dynamically adjusted. Initially, set it to a lower value (e.g., 10%) during the migration phase. Once the Dubbo interface is running stably, gradually increase it to 30%, 50%, and eventually to 100%. Each adjustment only requires modifying the scaling ratio value in the configuration center; the gateway pulls the updated configuration in real time, eliminating the need to restart the service.
[0105] II. Whitelist-based strategies.
[0106] A whitelist-based strategy involves forcibly routing requests from specific clients or users to the business orchestration layer, regardless of the scale of deployment. This strategy is used by internal testers to perform targeted verification of the business orchestration layer during the initial stages of a canary migration or after an issue has been resolved.
[0107] Specifically, developers enter a whitelist in the configuration center. The whitelist records one or more target identifiers, which are unique identifiers that can identify the client, including but not limited to: user account (e.g., driver ID), unique device identifier (e.g., device IMEI number), client IP address, or custom business tags (e.g., tags specific to the internal testing team). The whitelist supports dynamic hot reloading, meaning modifications take effect without requiring a service restart. When the gateway receives a client request, it extracts the source identifier from the HTTP request and matches it against the target identifiers in the whitelist. If a match is found, the gateway ignores the current traffic allocation configuration and directly routes the request to the business orchestration layer; if a match fails, other traffic scheduling strategies are executed.
[0108] It's important to note that the whitelist policy takes precedence over the proportion-based policy. That is, when the source identifier of an HTTP request matches the whitelist policy, forced routing is executed directly, and the proportion-based rate adjustment is no longer performed. This priority design ensures that, at any migration stage (including when the rate adjustment is 0%), internal testers can continuously verify the correctness of the new interface path using whitelisted accounts.
[0109] This strategy remains in effect until the full migration is complete, and is used for: verifying the correctness of the basic functionality of the Dubbo interface during the migration preparation phase; during migration execution, after offline Diff reports identify and fix inconsistencies in fields, testers initiate regression test requests through whitelisted accounts to quickly verify the fix's effectiveness; and before the full migration is complete, operations personnel initiate final acceptance tests through whitelisted accounts to confirm that the new pipeline performs as expected in the production environment. This strategy is implemented throughout the migration preparation, execution, and closure phases, providing a controllable testing and verification method for the entire migration process.
[0110] III. Strategies based on business attributes.
[0111] A business attribute-based strategy determines the routing target based on the business-dimensional information carried in the request. This strategy is used to achieve fine-grained canary deployment control based on business dimensions.
[0112] Specifically, developers set business attribute rules in the configuration center, such as "only requests for the city 'Beijing' are routed to the business orchestration layer" or "only requests for the driver level 'VIP' are routed to the business orchestration layer." After receiving a client request, the gateway extracts the corresponding business attribute values (such as city information, driver level, etc.) from the request parameters, matches them with the configured rules, routes successfully matched requests to the business orchestration layer, and routes unmatched requests to the HTTP interface.
[0113] The business attribute-based strategy supports multiple condition combinations. For example, routing to the business orchestration layer is only possible when both "the city is 'Beijing' and the driver's level is 'VIP'" are met, or routing to the business orchestration layer is possible if either "the city is 'Beijing' or 'Shanghai'" is met. This strategy enables migration verification to prioritize core business scenarios or high-risk scenarios, achieving fine-grained canary releases with controllable risks.
[0114] IV. Time-Window-Based Strategies
[0115] A time-window-based strategy determines the routing target based on the relationship between the current time and a preset time window. This strategy is used to automatically increase the scaling-up ratio during off-peak hours and automatically decrease the scaling-up ratio during peak hours to reduce the impact of migration on online services.
[0116] Specifically, developers set time window rules in the configuration center, such as "2:00 AM to 5:00 AM is the off-peak period, and the volume release ratio automatically increases to 50%; 7:00 AM to 9:00 AM is the morning peak period, and the volume release ratio automatically decreases to 5%." After receiving a client request, the gateway obtains the current system time, determines whether the current time falls within the configured time window, and applies the corresponding volume release ratio based on the determination result.
[0117] Time-window-based strategies can be combined with other strategies, such as ratio-based strategies. For example, applying a 50% volume increase during off-peak hours and a 5% volume increase during peak hours allows for time-based traffic scheduling, ensuring migration progress while minimizing the impact on core online business hours.
[0118] V. Combining multiple strategies.
[0119] The above four strategies can be used individually or in combination to form a multi-dimensional, multi-level grayscale control system.
[0120] In one possible combination, the whitelist-based strategy of this application embodiment has the highest priority and is used for forced routing by internal testers; the next is the business attribute-based strategy, used for targeted verification in specific business scenarios; followed by the time window-based strategy and the proportion-based strategy, used for dynamic allocation of regular traffic. When multiple strategies are used in combination, they are judged in descending order of priority. Once a high-priority strategy is hit, subsequent strategy judgments are not executed.
[0121] The above implementation provides a variety of traffic scheduling strategies and their combinations, enabling operations and maintenance personnel to flexibly select the most suitable traffic control method based on migration progress, business characteristics, and system load. This achieves an upgrade from simple proportional volume increase to multi-dimensional refined canary scheduling, effectively reducing the risk of business interruption caused by full-scale switching.
[0122] In one alternative implementation, after the HTTP response is returned to the gateway, the service orchestration layer asynchronously collects the HTTP response and reports the collected HTTP response as data to be verified to the log center for consistency comparison with the response data directly returned by the HTTP interface.
[0123] Specifically, the business orchestration layer asynchronously copies the HTTP response data (including request parameters, response content, traceId, timestamp, interface identifier, etc.) through the SDK interception unit while or after returning the HTTP response to the gateway, and marks the data source as "NEW" (indicating it originates from a new link in the business orchestration layer). This asynchronous collection method ensures that the collection process does not block the main business process and does not affect the real-time nature of the response returned to the client. The collected data is reported to a log center (such as an SLS log service) through the configured log reporting address for use by the consistency verification module.
[0124] Similarly, the SDK deployed at the original business's HTTP interface synchronously collects the response data directly returned by the HTTP interface, marks the data source as "OLD," and reports it to the same log center. The log center associates the response data of the same request on both the old and new paths by traceId, providing a data foundation for subsequent consistency comparisons. The collection process continues throughout the day, covering all requests, rather than just sampling a portion of them.
[0125] In one optional implementation, the consistency comparison in this application includes field-level comparison, which includes checking at least one of the following comparison dimensions: field existence, field value consistency, and data type compatibility.
[0126] Specifically, the offline Diff unit of the consistency verification module reads the previous day's response logs from the log center every day at midnight (e.g., 2 AM), associates the response data of OLD and NEW by traceId (only associates requests that have both OLD and NEW data to ensure consistent comparison benchmarks), and performs the following field-level comparisons: I. Field Existence Check.
[0127] Using the OLD response as a baseline, check if the NEW response contains all fields from the OLD response. For example, if the OLD response contains a driver_id field, check if the converted NEW response also contains the driver_id field. If a field exists in the OLD response but is missing in the NEW response, record it as a "Field Missing" difference.
[0128] 2. Field value consistency check.
[0129] For fields present in both the OLD and NEW responses, compare their values for consistency. For example, if the order_no is "OD001" in the OLD response, check if the order_no is also "OD001" after conversion in the NEW response. If the values are inconsistent, record this as a "value deviation" difference, and record both the OLD and NEW values to help locate the problem.
[0130] III. Data type compatibility check.
[0131] Check if the data types of the same field in the OLD and NEW responses are compatible. For example, if the driver_id in the OLD response is the string "123", and the NEW response converts it to the integer 123, it is considered compatible (the values are equal). If the status in the OLD response is the string "active", and the NEW response converts it to the integer 1, it is considered incompatible (the types are different and cannot be directly compared equivalently), and the record is marked as "Type Incompatibility".
[0132] In one optional implementation, the result of the consistency comparison in this application is used to generate a difference report, which is used to trigger an alarm when the difference rate exceeds a first preset threshold.
[0133] Specifically, after the offline Diff unit completes the field-level comparison, it generates a difference report. The difference report contains the following: I. Statistical Information.
[0134] The total number of requests compared, the number of inconsistent requests, and the inconsistency rate (number of inconsistent requests / total number of requests × 100%). For example, "The driver_order_create interface compared 10,000 requests, found 20 inconsistencies, and had an inconsistency rate of 0.2%".
[0135] II. Typical Cases.
[0136] The discrepancy report lists typical inconsistency cases, including traceId, OLD response content, NEW response content, a list of inconsistent fields, and the discrepancy type (field missing / value deviation / type incompatibility), to help operations personnel locate the cause of the problem. For example, "traceId=abc123, inconsistent field is create_t (OLD value is 1693526400000, NEW value is empty, discrepancy type: field missing)".
[0137] III. Alarm Judgment.
[0138] If the inconsistency rate exceeds a first preset threshold (e.g., 1%), an alarm (e.g., a DingTalk alarm) is triggered, along with a link to the discrepancy report, notifying operations personnel to intervene. After reviewing the discrepancy report, operations personnel locate the cause of the problem based on typical cases—if it's a field mapping error (e.g., a configuration error in the create_t conversion function), modify the field mapping rules in the configuration management module; if it's a Dubbo interface return exception (e.g., an incorrect order_status value), coordinate with the original business team to fix it. After fixing, a test request is initiated through a whitelist of drivers to confirm that the inconsistency issue has been resolved before continuing the migration.
[0139] In one optional implementation, after asynchronously collecting the HTTP response, the business orchestration layer periodically obtains its own real-time operating metrics, which include at least one of the service success rate and response time of the business orchestration layer; when the service success rate is lower than a second preset threshold and / or the response time is lower than a third preset threshold, a policy adjustment instruction is sent to the configuration center to make the configuration center reduce the traffic allocation ratio in the traffic scheduling policy.
[0140] Specifically, the business orchestration layer starts another independent background thread to periodically (e.g., every minute) obtain its own real-time performance metrics, including: I. Service success rate.
[0141] The success rate is the percentage of requests successfully processed by the business orchestration layer within a preset time window (e.g., the most recent minute) out of the total number of requests. If the success rate is lower than a second preset threshold (e.g., 99.9%), it indicates that there may be code defects in the business orchestration layer or abnormal dependent services.
[0142] II. Response time.
[0143] The business orchestration layer processes requests within a preset time window using a P99 response time (i.e., 99% of requests are completed within this time). When the P99 response time exceeds a third preset threshold (e.g., 500ms), it indicates that the business orchestration layer may have a performance bottleneck.
[0144] When the service success rate falls below the second preset threshold and / or the response time falls below the third preset threshold, the service orchestration layer proactively sends a policy adjustment instruction to the configuration center. This instruction includes the target load factor to be reduced (e.g., reducing the current load factor by 50% or reducing it to a safe level, such as 5%). Upon receiving the instruction, the configuration center reduces the load factor in the traffic scheduling policy to the target value. The next time the gateway retrieves the configuration, it executes the reduced load factor, thereby reducing the number of requests routed to the service orchestration layer, protecting it from traffic overload, and achieving system self-protection.
[0145] For example, if the current service success rate of the business orchestration layer is 99.5%, which is lower than the second preset threshold of 99.9%, then an instruction is sent to the configuration center to reduce the throughput ratio from 30% to 15%. The gateway then adjusts the throughput ratio to 15%, reducing the number of requests routed to the business orchestration layer.
[0146] Based on the foregoing description, this embodiment of the application constructs a complete system to ensure the conversion and migration of HTTP and Dubbo protocols through the collaborative work of the service orchestration layer, intelligent gateway, configuration center, and log center. The overall beneficial effects of this system include: I. Achieve closed-loop control of traffic scheduling.
[0147] This application dynamically adjusts traffic scheduling strategies from both routing statistics and operational metrics perspectives, forming a closed-loop control mechanism of "execution-monitoring-feedback-adjustment." When the operational status of the service orchestration layer deteriorates, the system can automatically detect and proactively adjust the volume release ratio, ensuring that the gray-scale migration process remains under control. This achieves automated operation and maintenance of the migration process, reducing the need for manual intervention.
[0148] 2. Achieve automatic monitoring of migration quality.
[0149] This application achieves automatic monitoring of business data quality during migration by performing full collection and field-level consistency comparison of the HTTP responses after business orchestration layer transformation. The coverage is far higher than that of existing manual sampling comparison schemes. Automatic alarms are triggered when the difference rate exceeds a threshold, enabling timely location and repair of problems. This effectively ensures the accuracy and integrity of business data during migration and avoids business interruptions caused by incorrect field mapping or protocol conversion anomalies.
[0150] 3. Achieve a smooth migration between the old and new interfaces.
[0151] This application achieves seamless client-side interface migration through bidirectional protocol conversion and canary traffic scheduling capabilities. The client consistently sends HTTP requests and receives HTTP responses using the old protocol, requiring no modifications. The backend business smoothly switches from the HTTP interface to the Dubbo interface, achieving integration through protocol conversion at the business orchestration layer. The entire migration process is rolled out gradually using a canary strategy, ensuring manageable risks and allowing for rapid rollback in case of anomalies, ultimately achieving a full migration.
[0152] Fourth, a system architecture with separation of responsibilities among modules and high cohesion and low coupling has been achieved.
[0153] The intelligent gateway handles routing decisions, the business orchestration layer handles protocol conversion, the configuration center manages policies, and the log center collects and stores data. These modules collaborate through standardized interfaces without interfering with each other. This architecture allows each module to be developed, deployed, and scaled independently. A failure in one module will not affect the normal operation of other modules, and any module can be independently replaced or upgraded, significantly improving the system's maintainability and scalability.
[0154] Based on the same inventive concept, embodiments of this application provide a device for converting between the HTTP protocol and the Dubbo protocol. Please refer to... Figure 2 The device includes: The parameter conversion unit 201 is used to obtain configuration information, including the mapping relationship and field mapping rules between the HTTP interface and the Dubbo interface; receive HTTP requests forwarded by the gateway and sent by the client; and convert the HTTP protocol parameters of the HTTP request into Dubbo protocol parameters according to the field mapping rules.
[0155] The response receiving unit 202 is used to serialize the converted Dubbo protocol parameters to generate a call request that conforms to the Dubbo protocol format; send the call request to the Dubbo interface according to the mapping relationship; and receive the Dubbo response returned by the Dubbo interface.
[0156] Protocol conversion unit 203 is used to deserialize the Dubbo response and convert the deserialized Dubbo response into an HTTP response according to the field mapping rules; the HTTP response is returned to the gateway so that the gateway can return the HTTP response to the client.
[0157] The HTTP protocol to Dubbo protocol conversion device provided in this application embodiment and the HTTP protocol to Dubbo protocol conversion method in the above embodiment have the same beneficial effects, and will not be described in detail here.
[0158] Having introduced the HTTP protocol to Dubbo protocol conversion method and the HTTP protocol to Dubbo protocol conversion apparatus according to exemplary embodiments of this application, the electronic device provided according to embodiments of this application will now be described.
[0159] This application provides an electronic device that can implement the HTTP protocol to Dubbo protocol conversion method discussed above. Please refer to... Figure 3 The device includes a memory 301, a processor 302, and a bus 303.
[0160] The memory 301 is used to store computer programs executed by the processor 302. The memory 301 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0161] Memory 301 may be volatile memory, such as random-access memory (RAM); memory 301 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 301 may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 301 may be a combination of the above-mentioned memories.
[0162] Processor 302 may include one or more central processing units (CPUs) or digital processing units, etc. Processor 302 is used to implement the HTTP protocol to Dubbo protocol conversion method in the above embodiments when calling the computer program stored in memory 301.
[0163] This application embodiment does not limit the specific connection medium between the memory 301 and the processor 302 described above. This application embodiment... Figure 3 The memory 301 and the processor 302 are connected via a bus 303, and the bus 303 is in Figure 3 The connections between other components are shown in thick lines only and are not intended to be limiting. Bus 303 can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0164] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium. The computer program product includes computer program code, which, when executed on a computer, causes the computer to perform any of the HTTP and Dubbo protocol conversion methods discussed above. Since the principle by which the above-described computer-readable storage medium solves the problem is similar to the HTTP and Dubbo protocol conversion methods, the implementation of the above-described computer-readable storage medium can be found in the implementation of the method; repeated details will not be elaborated further.
[0165] Based on the same inventive concept, this application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to execute any of the HTTP and Dubbo protocol conversion methods discussed above. Since the principle by which the above computer program product solves the problem is similar to the HTTP and Dubbo protocol conversion methods, the implementation of the above computer program product can refer to the implementation of the method, and repeated details will not be elaborated further.
[0166] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0167] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0168] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0169] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of user-operated steps to be executed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.
[0170] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for converting between HTTP protocol and Dubbo protocol, characterized in that, Applied to the business orchestration layer, including: Obtain configuration information, which includes the mapping relationship and field mapping rules between the HTTP interface and the Dubbo interface; Receive HTTP requests forwarded by the gateway and sent by the client; The HTTP protocol parameters of the HTTP request are converted into Dubbo protocol parameters according to the field mapping rules. The converted Dubbo protocol parameters are serialized to generate a call request that conforms to the Dubbo protocol format; The call request is sent to the Dubbo interface according to the mapping relationship, and the Dubbo response returned by the Dubbo interface is received. The Dubbo response is deserialized, and the deserialized Dubbo response is converted into an HTTP response according to the field mapping rules. The HTTP response is returned to the gateway, which then returns the HTTP response to the client.
2. The method according to claim 1, characterized in that, The field mapping rules include at least one of field name mapping, data type conversion, and custom conversion logic.
3. The method according to claim 1, characterized in that, The HTTP request is routed by the gateway to the service orchestration layer according to a dynamic traffic scheduling strategy.
4. The method according to claim 3, characterized in that, The traffic scheduling strategy includes at least one of the following strategies: a ratio-based strategy, a whitelist-based strategy, a business attribute-based strategy, a time window-based strategy, and a combination of the above strategies.
5. The method according to claim 4, characterized in that, After returning the HTTP response to the gateway, the process also includes: The HTTP response is collected asynchronously, and the collected HTTP response is reported to the log center as data to be verified, so as to compare its consistency with the response data directly returned by the HTTP interface.
6. The method according to claim 5, characterized in that, The consistency comparison includes field-level comparison, which includes checking at least one of the following comparison dimensions: field existence, field value consistency, and data type compatibility.
7. The method according to claim 5, characterized in that, The results of the consistency comparison are used to generate a difference report, which is used to trigger an alarm when the difference rate exceeds a first preset threshold.
8. The method according to claim 3, characterized in that, The traffic scheduling strategy includes a whitelist strategy; Before the gateway performs routing according to the traffic scheduling policy, the following is also included: Obtain the source identifier of the HTTP request returned by the gateway; When the source identifier matches the target identifier recorded in the whitelist policy, a forced routing instruction is sent to the gateway so that the gateway routes the HTTP request carrying the target identifier to the service orchestration layer.
9. The method according to claim 7, characterized in that, After asynchronously collecting the HTTP response, the process also includes: The real-time operating metrics of the service orchestration layer are periodically acquired, and the real-time operating metrics include at least one of the service success rate and response time of the service orchestration layer. When the service success rate is lower than the second preset threshold and / or the response time is lower than the third preset threshold, a policy adjustment instruction is sent to the configuration center so that the configuration center reduces the traffic allocation ratio in the traffic scheduling policy.
10. A device for converting between HTTP protocol and Dubbo protocol, characterized in that, The device includes: The parameter conversion unit is used to obtain configuration information, including the mapping relationship and field mapping rules between the HTTP interface and the Dubbo interface; receive HTTP requests forwarded by the gateway and sent by the client; and convert the HTTP protocol parameters of the HTTP request into Dubbo protocol parameters according to the field mapping rules. The response receiving unit is used to serialize the converted Dubbo protocol parameters to generate a call request that conforms to the Dubbo protocol format; send the call request to the Dubbo interface according to the mapping relationship; and receive the Dubbo response returned by the Dubbo interface. The protocol conversion unit is used to deserialize the Dubbo response and convert the deserialized Dubbo response into an HTTP response according to the field mapping rules; and return the HTTP response to the gateway so that the gateway can return the HTTP response to the client.
