Method and system for visually configuring dynamic baffle

By using a visual configuration method and system for dynamic baffles, the problems of insufficient multi-protocol support, complex configuration, and static response in existing technologies are solved. This enables flexible multi-protocol simulation and dynamic response, improving testing efficiency and system adaptability.

CN121880221APending Publication Date: 2026-04-17北京领雁科技股份有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
北京领雁科技股份有限公司
Filing Date
2025-12-29
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

The existing baffle system lacks unified support for multiple protocols, has a simple response condition matching mechanism, requires service restarts for configuration changes, lacks dynamic characteristics in response messages, cannot achieve seamless switching of real services, and has a complex configuration process that requires the participation of professional technicians.

Method used

This paper provides a method and system for configuring dynamic baffles in a visual manner. It supports multiple protocol types, allows users to input baffle configuration information through a visual interface, enables dynamic conditional expressions and runtime variable replacement, and ensures that the configuration information takes effect in real time. It also supports seamless switching between the baffle and the real service.

Benefits of technology

It supports multiple protocols, improves system testing efficiency, enhances system compatibility and adaptability, supports dynamic response features, reduces dependence on third-party systems, and simplifies the configuration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121880221A_ABST
    Figure CN121880221A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computer software testing, in particular to a method and system for visually configuring a dynamic baffle, and the method comprises the steps: receiving baffle configuration information inputted by a user through a visual interface; a baffle service is started, the simulation response address is traversed according to baffle configuration information, and corresponding port monitoring is started; after the monitoring port receives the request message, preferentially matching whether the port has a baffle response message for opening simulation response, if so, performing simulation response logic processing, and if not, forwarding the request message to a third-party service and returning a response; the simulation response logic processing is used for performing differential simulation response matching processing according to the baffle type. According to the method and the system for dynamically expanding the non-HTTP protocol based on the single framework and in combination with the micro-service gateway, baffle configuration of various communication protocols and message formats is realized, various communication protocols are supported, autonomous expansion is supported, and the compatibility and the adaptability of the system are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer software testing, and in particular to a method and system for visually configuring dynamic baffles. Background Technology

[0002] As software systems become increasingly complex and large-scale, inter-system interactions are becoming more frequent, especially during the domestic IT innovation reform process, where migrating the original system involves extensive third-party integration testing. In this context, the cooperation of third-party systems becomes an uncontrollable factor in the project, making the effective simulation of third-party system responses a key issue in controlling project risks.

[0003] Currently, various message parsing and service simulation technologies are available on the market. For example, CN117041387B discloses a message parsing method and apparatus. This method obtains probe behavior configuration information and message parsing rules based on a configuration file, captures message data, and parses it, achieving message parsing support for heterogeneous systems. CN117675664A provides a service simulation method. After obtaining a request message, it adapts the communication protocol according to the communication routing to determine the backend service that processes the request message, and determines the response route based on the interface routing rules and response routing rules in the request protocol, then feeds back the response message to the requesting system.

[0004] In the field of baffle testing, CN114064327A discloses a baffle testing method, which obtains the baffle configuration information of the target baffle to be started, determines the baffle adapter corresponding to the target protocol of the target baffle, and runs the baffle adapter in a new baffle thread to perform baffle testing. CN108874565A proposes a baffle service method and system, including receiving a request message sent by a requester, determining the response method of the request message according to the preset baffle content, and generating a response message of the request message based on the response method. In addition, CN113596017B introduces a protocol parsing method, which sends a request message to a hardware device, receives a response message, and performs protocol parsing on the response message according to the protocol class library of the Internet of Things protocol.

[0005] However, existing technologies still have the following shortcomings:

[0006] First, most existing baffle systems are designed for specific protocols and lack unified support for multiple protocols (such as HTTP, HTTPS, TCP, SFTP, etc.), making it difficult to meet the multi-protocol simulation requirements in complex system integration environments.

[0007] Second, the response condition matching mechanism in the existing technology is relatively simple, usually using fixed rule matching, and lacks the ability to support dynamic condition expressions that support field comparison, logical operations and built-in functions, making it unable to flexibly cope with complex business scenarios.

[0008] Third, configuration changes to the existing baffle system usually require a service restart to take effect, which cannot achieve real-time configuration changes and affects testing efficiency.

[0009] Fourth, most response message templates in existing technologies are static and lack runtime variable support, such as the automatic generation and replacement of dynamic values ​​like timestamps, serial numbers, and random numbers, making it difficult to simulate the dynamic response characteristics of real systems.

[0010] Fifth, existing shielding systems often simply return error messages when processing unmatched requests, lacking the ability to forward requests to the real service and thus failing to achieve seamless switching between the shield and the real system.

[0011] Finally, existing technologies lack a visual configuration interface, the configuration process is complex and requires the participation of professional technicians, which is not conducive to the independent operation of testers.

[0012] Therefore, there is an urgent need for a method and system for visually configuring dynamic baffles that can support multiple protocol types, provide dynamic conditional expressions and runtime variable substitution capabilities, enable real-time configuration, and automatically forward to the real service when baffle matching fails, thereby effectively solving the third-party dependency problem in system integration testing. Summary of the Invention

[0013] To address the increasing complexity and scale of software systems, and the growing number of systems interacting with multiple third-party systems, especially during the domestic IT innovation reform, where the migration of original systems involves extensive third-party integration testing, the cooperation of third parties becomes an uncontrollable factor in the entire project. There is a lack of a system capable of simulating multiple protocols and message formats, supporting independent expansion, and providing visual configuration of timeout barriers, custom barriers, and dynamic barriers to solve the technical problem of integration with third parties. This application provides a method and system for visually configuring dynamic barriers.

[0014] According to a first aspect of the present invention, a method for visually configuring dynamic baffles is provided, comprising: receiving baffle configuration information input by a user through a visual interface; activating a baffle service, traversing simulated response addresses and activating corresponding port listening according to the baffle configuration information; when the listening port receives a request message, using the variable fields contained in the request message, and according to the response expressions configured with different conditions, prioritizing the matching of whether the port has a baffle response message with simulated response enabled; if it exists, performing simulated response logic processing; if it does not exist, forwarding the request message to a third-party service and returning a response; the simulated response logic processing performs differentiated simulated response matching processing according to the baffle type.

[0015] Optionally, the baffle configuration information includes: the protocol type of the simulated response, the response expression, dynamic variables, and protocol parsing parameters associated with the protocol type.

[0016] Optionally, the protocol type of the simulated response includes at least one of HTTP, HTTPS, TCP, and SFTP protocols, and supports custom protocol types extended through SDK; the response expression includes a set of operators; the dynamic variables are system-preset dynamic values ​​related to the request context, including one or more of timestamps, serial numbers, and random numbers, and are dynamically parsed during the response message return phase; the protocol parsing parameters associated with the protocol type include at least one of port number, character set, message length encoding method, transaction code XPath expression, and heartbeat packet configuration.

[0017] Optionally, the baffle type includes simple custom baffles and complex custom baffles. When performing simulated response logic processing, the response message configured by the simple custom baffle is matched first. The system checks whether a response message configured by the simple custom baffle exists based on the link address. If it exists and timeout is not enabled, the corresponding response message is returned directly. If it exists and timeout is enabled, the system waits for the timeout period to expire before returning. If no response message configured by the simple custom baffle exists, the system calls the corresponding protocol adapter to perform subsequent protocol conversion and message conversion on the request message based on the address configuration information, obtains the transaction code, and matches whether a response message configured by the complex custom baffle exists based on the transaction code. If it exists and timeout is not enabled, the corresponding response message is returned directly. If it exists and timeout is enabled, the system waits for the timeout period to expire before returning, without further processing. If no response message configured by the complex custom baffle is matched based on the transaction code, an empty string is returned. During the response message return stage, the response message content of the simple custom baffle or complex custom baffle response is dynamically generated and returned based on dynamic variables fed back from actual business data.

[0018] Optionally, the response message of the simple custom baffle configuration is a locally configured response message, which is only applicable to requests with HTTP / HTTPS protocol and JSON message format. No protocol conversion or message conversion is required. The baffle configuration is directly matched based on the request URL path. The response message of the complex custom baffle configuration is a locally configured response message that needs to be processed through process orchestration. It is applicable to request messages with non-HTTP protocol or non-JSON format.

[0019] Optionally, the protocol adapter is dynamically loaded through a plug-in mechanism, supporting the dynamic loading of new protocol parsers and message converters via the SDK. The SDK provides interface definitions and abstract classes for third-party extensions.

[0020] Optionally, receiving the baffle configuration information input by the user through the visual interface includes: creating a new baffle service; binding an externally exposed address to the baffle service; creating a simple custom baffle or binding a complex custom baffle to the address; wherein the simple custom baffle includes a directly configured response expression and a response message; the complex custom baffle is configured with a transaction code, and after calling the protocol adapter to parse the request message and obtain the transaction code, the corresponding complex custom baffle is called through the obtained transaction code; after starting the baffle service, the simulated response address is traversed according to the externally exposed address bound to the baffle service and the corresponding port is started for listening.

[0021] Optionally, the baffle configuration information is stored in a database, loaded into a memory cache when the service starts, and takes effect in real time through a cache refresh mechanism when the configuration is updated, without the need to restart the service.

[0022] Optionally, it also includes: prioritizing the matched baffle configurations according to the sorting field in the baffle configuration, performing the matching in order, and making the first matched baffle configuration effective.

[0023] According to a second aspect of the present invention, a system for visually configuring dynamic baffles is provided, comprising: a configuration receiving module for receiving baffle configuration information input by a user through a visual interface; a port listening module for enabling baffle services, traversing simulated response addresses and enabling corresponding port listening according to the baffle configuration information; and a request processing module for, when the listening port receives a request message, using variable fields contained in the request message and according to response expressions configured with different conditions, prioritizing matching whether the port has a baffle response message that enables simulated response, if it exists, performing simulated response logic processing, and if it does not exist, forwarding the request message to a third-party service and returning a response; wherein the simulated response logic processing performs differentiated simulated response matching processing according to the baffle type.

[0024] The present invention provides a method and system for visually configuring dynamic baffles, which has the following beneficial effects:

[0025] 1. Based on a monolithic architecture, this system combines a microservice gateway to dynamically extend non-HTTP protocols and implements sash configurations for various communication protocols and message formats. It supports multiple communication protocols (HTTP, HTTPS, TCP, SFTP, etc.) and allows for independent extension, enhancing the system's compatibility and adaptability.

[0026] 2. Supports multiple message formats and allows for independent expansion to meet the needs of different business scenarios.

[0027] 3. Baffle information is stored in a database table and refreshed to the cache, so changes take effect in real time without restarting the service, improving system availability and maintenance efficiency.

[0028] 4. Supports configuring timeout barriers, which can simulate network latency or processing latency in real-world environments.

[0029] 5. Supports dynamic configuration of baffle content based on request parameters. The baffle content supports dynamic assignment, which improves the flexibility and realism of the system.

[0030] 6. Effectively control project risks, resolve issues related to joint debugging with third parties, reduce dependence on third-party systems, and accelerate development and testing progress. Attached Figure Description

[0031] The accompanying drawings, which are provided to further illustrate this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application.

[0032] Figure 1 This is the overall flowchart of the present invention.

[0033] Figure 2 This is a flowchart of the simulated response logic processing of the present invention.

[0034] Figure 3 This is a system framework diagram of the present invention.

[0035] Figure 4 This is a schematic diagram of an electronic device. Detailed Implementation

[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0037] Example 1

[0038] Existing baffle configuration methods suffer from low configuration efficiency and poor protocol compatibility. This application provides a method for visually configuring dynamic baffles. Please refer to... Figure 1 This method enables flexible simulation of responses across protocols, improving system testing efficiency. Specifically, it includes the following steps.

[0039] S1. Receive baffle configuration information input by the user through the visual interface.

[0040] The system receives baffle configuration information input by the user through a visual interface, including: creating a new baffle service (supporting independent deployment); binding an externally exposed address to the baffle service (this address mainly refers to the port, which is associated with the protocol, message adapter, and address parameters in address management); creating a simple custom baffle or binding a complex custom baffle to the address; where a simple custom baffle includes a directly configured response expression and a response message; a complex custom baffle requires a transaction code, which is used to call the corresponding complex custom baffle after the protocol adapter parses the request message and obtains the transaction code; in addition, complex custom baffles support low-code development of baffle logic through process orchestration, support dynamic addition of variables and context variable sharing, and the writing of complex response logic through built-in functions (such as ifelse, for, concat, substring, etc.).

[0041] The baffle configuration information includes the protocol type of the simulated response, the response expression, dynamic variables, and protocol parsing parameters associated with the protocol type. The simulated response protocol type includes at least one of HTTP, HTTPS, TCP, and SFTP protocols, and supports custom protocol types extended via the SDK. The response expression supports Expression Language (EL) syntax and includes a set of operators, including at least one of >, <, ≤, ≥, =, .equals, @str.isNotBlank, and @coll.isNotEmpty. It should be noted that the response expression supports dynamic logical operations on request message parameters. Request message parameters refer to all messages in the business transaction request, containing transaction codes and business information (such as customer number, account number, etc.). The response expression matches a specific field in the request message; for example, uploading to customer A returns customer A's account number, and uploading to customer B returns customer B's account number. Dynamic variables include at least one of the transDate transaction date variable and the @math:randomInt random number function, and are dynamically parsed during the response message return phase. Protocol parsing parameters associated with the protocol type include at least one of the following: port number, character set, message length encoding method, transaction code XPath expression, and heartbeat packet configuration, used to parse binary messages of non-HTTP protocols.

[0042] The baffle configuration information is stored in the database and loaded into the memory cache when the service starts. When the configuration is updated, it takes effect in real time through the cache refresh mechanism without restarting the service.

[0043] The database includes a baffle configuration table, an address information table, and an address parameter table. The baffle configuration table primarily stores baffle configuration information, which is configured by the page. It is mainly used to return corresponding response messages based on the baffle configuration when external requests are made, and includes the `interface_id` field, the `baffle_type` field, and the `response_message` field. The address information table and address parameter table store address configuration information. The address information table mainly configures information such as the address, port, corresponding protocol, and adapter of the service provided, including fields such as `addr_port` (port number) and `msg_comp_id` (protocol handler). The address parameter table is mainly used to parse transaction codes; it includes keep-alive, timeout (seconds), buffer size, character set, message length encoding method, message length inclusion method, start byte of received message length, end byte of received message length, start byte of sent message length, end byte of sent message length, length data alignment, length padding character (hexadecimal), heartbeat packet, length separator (hexadecimal), transaction code XPath, transaction code start tag, transaction code end tag, etc. These parameters together determine how the system parses and processes messages from non-HTTP protocols.

[0044] The memory cache adopts a strategy of directly loading the database into memory. When a change in the version number of the configuration information in the database table is detected, the cached data can be updated within 100 milliseconds.

[0045] S2. Enable the shield service, traverse the simulated response addresses according to the shield configuration information and start listening on the corresponding ports.

[0046] Port listening is implemented using the Netty framework, which creates an independent thread pool for each simulated response protocol type to receive request messages.

[0047] After enabling the shield service, iterate through the simulated response addresses based on the externally exposed addresses bound to the shield service and start listening on the corresponding ports.

[0048] S3. When the listening port receives a request message, it first checks whether there is a shielded response message that enables simulated response on the port. If it exists, it performs simulated response logic processing. If it does not exist, it forwards the request message to the third-party service and returns a response.

[0049] The simulated response logic processing performs differentiated simulated response matching based on the baffle type.

[0050] Baffle types include simple custom baffles and complex custom baffles.

[0051] Reference Appendix Figure 2 When performing the simulated response logic processing flow, the following steps are specifically executed:

[0052] S31. Prioritize matching response messages with simple custom baffle configurations. Check if a response message with a simple custom baffle configuration exists based on the link address. If it exists and timeout is not enabled, directly return the corresponding response message. The response message contains dynamic variables, which the system automatically parses and replaces with real-time data. These dynamic variables are system-preset dynamic values ​​related to the request context, including one or more of timestamps, serial numbers, and random numbers. During the response message rendering phase, the EL utility class performs conversion processing to dynamically replace them with real data. If a response message exists and timeout is enabled, wait for the timeout period to expire before returning; no further protocol or message conversion is required.

[0053] S32. If there is no response message with a simple custom baffle configuration, then according to the address configuration information (specifically, the address information table and address parameter table information), the corresponding protocol adapter is called to perform subsequent protocol conversion and message conversion on the request message, obtain the transaction code, and then match the transaction code again to see if there is a response message with a complex custom baffle configuration. If it exists and timeout is not enabled, then the corresponding response message is returned directly. If it exists and timeout is enabled, then it is necessary to wait for the timeout period to expire before returning, without any further processing.

[0054] S33. If no response message for the complex custom baffle configuration is found based on the transaction code, return empty.

[0055] It should be noted that when a port receives a request message, it first automatically identifies the communication protocol type based on the access traffic, prioritizing the check of whether the port has enabled simulated responses. If simulated responses are enabled, the system retrieves the locally configured baffle configuration information. Multiple baffles can be configured locally. In this embodiment, the baffles include simple custom baffles and complex custom baffles. The response message configured by the simple custom baffle is a locally configured response message, applicable only to HTTP / HTTPS requests with JSON format. No protocol or message conversion is required; the baffle configuration is directly matched based on the request URL path. If the response message contains dynamic variables, it can be converted to real data using the EL utility class. The response message configured by the complex custom baffle is a locally configured response message that requires process orchestration. It is applicable to request messages that are not HTTP or in non-JSON format. For example, if the response message contains dynamic variables, it can be converted to real data using the EL utility class. If the port does not have simulated responses enabled, the request message is directly forwarded to a third-party service via routing and a response is returned. In addition, this system retains request and response information for subsequent baffle configuration.

[0056] The response message for the baffle configuration will only be returned if the matching result is true (specifically, if the result of the response expression matching is true). For example, if a simple custom baffle configuration is matched, the response message for the corresponding simple custom baffle configuration will be returned.

[0057] The protocol adapter is dynamically loaded via a plug-in mechanism, supporting the dynamic loading of new protocol parsers and message converters through the SDK. The SDK provides interface definitions and abstract classes for third-party extensions.

[0058] If no simple custom baffle configuration is matched, the request message is processed according to the protocol parsing parameters, and the transaction code is extracted. Protocol conversion and message structure parsing include: extracting the transaction code from the XML message using the transaction code XPath expression, or truncating the transaction code segment from a fixed-length message using the recv_len_begin field. Based on the transaction code, the corresponding complex custom baffle configuration is matched, and if a complex custom baffle configuration is successfully matched, the same response generation logic as for the simple custom baffle configuration is executed.

[0059] When generating the response message, if the value of the blocking_time field is detected to be greater than zero, the final response message will be sent after the blocking time specified in the blocking_time field has ended.

[0060] S34. During the response message return phase, the response message content of the simple custom baffle or the complex custom baffle is dynamically generated and returned based on the dynamic variables fed back by the actual business data.

[0061] It should be noted that during the response message return phase, the system supports dynamic and visual expansion configuration of complex custom baffle logic and response messages with complex custom baffles. At the same time, it also supports dynamic addition of variables and sharing of context variables. Complex response logic can be written through built-in functions (such as ifelse, for, concat, substring, etc.), and the functions support self-expansion.

[0062] If no baffle configuration is matched, the request message is forwarded to a third-party service, and a response is returned. When forwarding to the third-party service, the association between the original request message and the third-party service response message is automatically recorded, and a debug log is generated to record the original content of the request message, the matching path, and the reason for failure to the logging system for subsequent automated analysis and baffle rule optimization.

[0063] In a preferred embodiment, when the response_message_flag (whether to simulate a response) field in the successfully matched baffle configuration is in a closed state, an empty message is returned directly without executing the response generation logic.

[0064] In a preferred embodiment, the system further includes a baffle configuration "priority" matching mechanism, which specifically sorts the matching baffle configurations according to the sorting field in the baffle configuration, performs matching in order, and the first successfully matched baffle configuration takes effect.

[0065] This application provides a method for visually configuring dynamic slats. This method supports multiple protocol types and, through flexible conditional expressions and dynamic variable parsing mechanisms, accurately simulates response behaviors under various business scenarios. Simultaneously, real-time application of configuration information and a multi-level cache refresh strategy ensure efficient system operation; new slat rules can be applied without restarting the service, significantly improving development and testing efficiency.

[0066] Example 2

[0067] Based on Embodiment 1 above, this embodiment also provides a system 200 for visually configuring dynamic baffles. Please refer to [link to previous document]. Figure 3 The system is used to implement the steps of a method for visually configuring a dynamic baffle as described in Embodiment 1 above. The main implementation modules of the system are: configuration receiving module 201, port listening module 202, and request processing module 203.

[0068] In a preferred embodiment, the configuration receiving module 201 is used to receive baffle configuration information input by the user through a visual interface. Simultaneously, the baffle configuration information is stored in a database and synchronized to a memory cache to achieve real-time effectiveness.

[0069] In a preferred embodiment, the port listening module 202 is used to enable the baffle service, traverse the simulated response addresses according to the baffle configuration information and enable the corresponding port listening.

[0070] In a preferred embodiment, the request processing module 203 is used to, when the listening port receives a request message, use the variable fields contained in the request message to first match whether there is a shield response message that enables simulated response on the port according to the response expression configured with different conditions. If there is, simulated response logic processing is performed; if not, the request message is forwarded to a third-party service and a response is returned. The simulated response logic processing performs differentiated simulated response matching processing according to the shield type.

[0071] In summary, the system 200 for visually configurable dynamic baffles provided in this application can achieve a high-fidelity baffle response in multi-protocol, multi-message, and high-concurrency third-party system integration testing. This response is characterized by "no need for restarting, dynamic configuration, intelligent matching based on request content, and the ability to inject real runtime variables," thus solving the integration testing blocking problem caused by the uncontrollability of third-party systems.

[0072] Example 3

[0073] Based on Embodiment 1 described above, this embodiment also provides an electronic device, please refer to the appendix. Figure 4 , Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.

[0074] like Figure 4 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0075] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, etc.; storage devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively. Figure 4 Each box shown can represent a device or multiple devices as needed.

[0076] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 309, or installed from storage device 308, or installed from ROM 302. When the computer program is executed by processing device 301, it performs the functions defined in the methods of some embodiments of this disclosure.

[0077] Example 4

[0078] Based on Embodiment 1 above, this embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above method.

[0079] It should be noted that, in some embodiments of this disclosure, the computer-readable medium described above may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), or any suitable combination thereof.

[0080] In this embodiment, the client and server can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0081] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0082] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including a configuration receiving unit, a port listening unit, and a request processing unit. The names of these units do not necessarily limit the specific unit; for example, the configuration receiving unit may also be described as "a unit that receives baffle configuration information input by a user through a visual interface."

[0083] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0084] Obviously, those skilled in the art will understand that the various steps of the present invention described above can be performed in a manner different from that described above, and the simulation methods and experimental equipment include, but are not limited to, the above description. The steps of the present invention described above can be performed in a different order in certain circumstances, and the steps shown or described above can be performed separately. Therefore, the present invention is not limited to any particular combination of hardware and software.

[0085] The above description, in conjunction with specific embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such deductions or substitutions should be considered within the scope of protection of the present invention.

Claims

1. A method for visually configuring dynamic baffles, characterized in that, include: Receive baffle configuration information input by the user through a visual interface; Enable the shield service, and traverse the simulated response addresses according to the shield configuration information and start listening on the corresponding ports. When the listening port receives a request message, it uses the variable fields contained in the request message to first match whether there is a shielded response message with simulated response enabled on the port according to the response expression with different configuration conditions. If it exists, it performs simulated response logic processing; if it does not exist, it forwards the request message to the third-party service and returns a response. The simulated response logic processing performs differentiated simulated response matching processing based on the baffle type.

2. The method for visually configuring dynamic baffles as described in claim 1, characterized in that, The baffle configuration information includes: the protocol type of the simulated response, the response expression, dynamic variables, and protocol parsing parameters associated with the protocol type.

3. The method for visually configuring dynamic baffles as described in claim 2, characterized in that, The simulated response protocol type includes at least one of HTTP, HTTPS, TCP, and SFTP protocols, and supports custom protocol types extended via SDK; the response expression contains a set of operators; the dynamic variables are system-preset dynamic values ​​related to the request context, including one or more of timestamps, serial numbers, and random numbers, and are dynamically parsed during the response message return phase; the protocol parsing parameters associated with the protocol type include at least one of port number, character set, message length encoding method, transaction code XPath expression, and heartbeat packet configuration.

4. The method for visually configuring dynamic baffles as described in claim 1, characterized in that, The baffle types include simple custom baffles and complex custom baffles; When performing the simulated response logic processing flow, the response message with simple custom baffle configuration is matched first. The system checks whether a response message with simple custom baffle configuration exists based on the link address. If it exists and timeout is not enabled, the corresponding response message is returned directly. If it exists and timeout is enabled, the system waits for the timeout period to expire before returning the response message. If there is no response message with a simple custom baffle configuration, the corresponding protocol adapter is called to perform subsequent protocol conversion and message conversion on the request message according to the address configuration information, obtain the transaction code, and then match the transaction code again to see if there is a response message with a complex custom baffle configuration. If it exists and timeout is not enabled, the corresponding response message is returned directly. If it exists and timeout is enabled, the response message is returned after the timeout period expires. No further processing is required. If no response message matching the complex custom baffle configuration is found based on the transaction code, return empty; During the response message return phase, the response message content of simple or complex custom baffles is dynamically generated and returned based on dynamic variables fed back from actual business data.

5. The method for visually configuring dynamic baffles as described in claim 4, characterized in that, The response message of the simple custom baffle configuration is a locally configured response message, which is only applicable to HTTP / HTTPS protocol requests with JSON message format. No protocol conversion or message conversion is required. The baffle configuration is directly matched based on the request URL path. The response message of the complex custom baffle configuration is a locally configured response message that needs to be processed through process orchestration. It is applicable to request messages that are not HTTP protocol or non-JSON format.

6. The method for visually configuring dynamic baffles as described in claim 4, characterized in that, The protocol adapter is dynamically loaded through a plug-in mechanism, supporting the dynamic loading of new protocol parsers and message converters via the SDK. The SDK provides interface definitions and abstract classes for third-party extensions.

7. The method for visually configuring dynamic baffles as described in claim 4, characterized in that, The process of receiving baffle configuration information input by the user through a visual interface includes: New baffle service; Bind the externally exposed address under the shield service; Create a simple custom baffle or bind a complex custom baffle under the address; wherein, the simple custom baffle includes a directly configured response expression and a response message; the complex custom baffle is configured with a transaction code, and after calling the protocol adapter to parse the request message and obtain the transaction code, the corresponding complex custom baffle is called through the obtained transaction code; After enabling the shield service, iterate through the simulated response addresses based on the externally exposed addresses bound to the shield service and start listening on the corresponding ports.

8. The method for visually configuring dynamic baffles as described in claim 1, characterized in that, The baffle configuration information is stored in the database and loaded into the memory cache when the service starts. When the configuration is updated, it takes effect in real time through the cache refresh mechanism without restarting the service.

9. The method for visually configuring dynamic baffles as described in claim 1, characterized in that, Also includes: The matching baffle configurations are prioritized according to the sorting field in the baffle configuration, and the matching is performed in order. The first matching baffle configuration takes effect.

10. A system for visually configuring dynamic baffles, characterized in that, include: The configuration receiving module is used to receive the baffle configuration information input by the user through the visual interface; The port listening module is used to enable the shield service. It iterates through the simulated response addresses according to the shield configuration information and starts listening on the corresponding ports. The request processing module is used to, when the listening port receives a request message, use the variable fields contained in the request message to first match whether there is a shield response message that enables simulated response on the port according to the response expression configured with different conditions. If it exists, simulated response logic processing is performed; if it does not exist, the request message is forwarded to a third-party service and a response is returned. The simulated response logic processing performs differentiated simulated response matching processing according to the shield type.

Citation Information

Patent Citations

  • Baffle service method and system

    CN108874565A

  • Service simulation method and device, readable storage medium and equipment

    CN117675664A

  • Interface agent system and method based on Web visual configuration

    CN121193776A