A simulation proxy calling method, device, computer equipment and storage medium
By using simulation proxy to call methods, obtain and verify simulation messages, generate interface services and repair parameters, the problems of poor deep monitoring and stability in existing technologies are solved, and deep monitoring and stability improvement of complex system stacks and cloud nodes are achieved.
Patent Information
- Application Number
- CN202010817991.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-14
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-08-14
AI Technical Summary
Existing protocol simulation technologies cannot achieve in-depth monitoring on complex system stacks and cloud nodes, and have poor stability, making them susceptible to interference from secondary factors.
The simulation proxy calls the method to obtain the simulation message of the user request, performs verification and initialization, generates the interface service, and calls the interface service to generate the call result. At the same time, the bytecode manipulation framework is used to repair parameters and fill in the protocol template to achieve deep monitoring.
It enables in-depth monitoring of complex system stacks and cloud nodes, improving the stability and reliability of the monitored targets.
Smart Images

Figure CN114077503B_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of communication technology, and in particular to a simulation proxy calling method, device, computer equipment and storage medium. [Background technology]
[0002] Today, protocol simulation is a technology widely used in the fields of fault perception, automated testing, and intelligent business acceptance. Its main function is to simulate calls between system layers or between cloud nodes. Existing protocol simulation is mainly oriented to the upper layer, usually the total entry or load address, and cannot achieve in-depth monitoring on complex system stacks and cloud nodes; existing protocol simulation requires the cooperation of multiple system components, and the real monitoring target is easily disturbed by secondary factors and has poor stability. [Summary of the invention]
[0003] In view of this, an embodiment of the present invention provides a simulation agent calling method, apparatus, computer equipment and storage medium, which can realize in-depth monitoring and improve the stability of the monitoring target.
[0004] On the one hand, an embodiment of the present invention provides a simulation agent calling method, the method comprising:
[0005] Obtaining a user request, where the user request includes a simulation message;
[0006] Verify the simulation message;
[0007] If the verification passes, the generated first interface service is initialized and a second interface service is generated;
[0008] The second interface service is called, and a calling result is generated according to the simulation message.
[0009] Optionally, before obtaining the user request, it also includes:
[0010] Get the working process, which includes multiple working threads;
[0011] Take multiple snapshots of each working thread at set time intervals to generate multiple thread information;
[0012] Generate parameter samples based on multiple thread information;
[0013] Write the parameter sample into the set protocol template to generate simulation messages.
[0014] Optionally, a parameter sample is generated based on information of multiple threads, including:
[0015] Generate a first interface service according to the plurality of thread information, wherein the first interface service includes a first key point and a second key point;
[0016] Extracting a first characteristic parameter from the first key point;
[0017] Extracting a second characteristic parameter from the second key point;
[0018] The first characteristic parameter and the second characteristic parameter are patched through the bytecode manipulation framework to generate a parameter sample.
[0019] Optionally, the first service interface includes a first transaction gateway address, each worker thread includes a thread local variable, and the thread local variable includes a second transaction gateway address;
[0020] Initializing the generated first interface service to generate a second interface service includes:
[0021] Determine whether the first transaction gateway address is the same as the second transaction gateway address;
[0022] If it is determined that the first transaction gateway address is different from the second transaction gateway address, destroy the first transaction gateway address;
[0023] Determine the second transaction gateway address as the first transaction gateway address;
[0024] A second interface service is generated, wherein the second interface service includes the first transaction gateway address.
[0025] Optionally, before determining whether the first transaction gateway address is the same as the second transaction gateway address, the method further includes:
[0026] Store the first transaction gateway address into a thread local variable.
[0027] Optionally, before calling the second interface service and generating a calling result according to the simulation message, the method further includes:
[0028] Deserialize the simulation message to generate a first editable object;
[0029] Modify the first editable object to generate a second editable object;
[0030] The second editable object is serialized to generate an updated simulation message.
[0031] Optionally, after calling the second interface service and generating a calling result according to the simulation message, the method further includes:
[0032] Destroy the second interface service.
[0033] On the other hand, an embodiment of the present invention provides a simulation proxy calling device, including:
[0034] A first acquisition unit, used to acquire a user request, where the user request includes a simulation message;
[0035] A first generating unit, used for verifying the simulation message;
[0036] A second generating unit is used to initialize the generated first interface service and generate a second interface service if the verification passes;
[0037] The third generating unit is used to call the second interface service and generate a calling result according to the simulation message.
[0038] On the other hand, an embodiment of the present invention provides a storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above-mentioned simulation proxy calling method.
[0039] On the other hand, an embodiment of the present invention provides a computer device, including a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, and is characterized in that the program instructions implement the above-mentioned simulation agent calling method when loaded and executed by the processor.
[0040] In the scheme of the embodiment of the present invention, a user request is obtained, and the user request includes a simulation message; the simulation message is verified; if the verification passes, the generated first interface service is initialized to generate a second interface service; the second interface service is called, and a calling result is generated according to the simulation message, so as to realize deep monitoring and improve the stability of the monitoring target.
Brief Description of the Drawings
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A schematic diagram of the structure of a simulation proxy calling system provided by an embodiment of the present invention;
[0043] Figure 2 A flowchart of a simulation proxy calling method provided by an embodiment of the present invention;
[0044] Figure 3 A flowchart of another simulation proxy calling method provided by an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of building a simulation agent provided by an embodiment of the present invention;
[0046] Figure 5 A structural diagram of a simulation proxy calling device provided by an embodiment of the present invention;
[0047] Figure 6 A schematic diagram of a computer device provided by an embodiment of the present invention. [Specific implementation method]
[0048] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0049] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0051] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0052] It should be understood that, although the terms first, second, etc. may be used to describe the set thresholds in the embodiments of the present invention, these set thresholds should not be limited to these terms. These terms are only used to distinguish the set thresholds from each other. For example, without departing from the scope of the embodiments of the present invention, the first set threshold may also be referred to as the second set threshold, and similarly, the second set threshold may also be referred to as the first set threshold.
[0053] Figure 1 A schematic diagram of a simulation proxy calling system provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the system includes: a management platform 1, a simulation agent 2 and a transaction middleware detection target 3. The management platform 1 is connected to the simulation agent 2, and the simulation agent 2 is connected to the transaction middleware detection target 3.
[0054] Management platform 1 is responsible for the management and scheduling of protocol simulation tasks, sending parameter samples to simulation agent 2, and receiving the scheduling results sent by simulation agent 2. Simulation agent 2 is a lightweight service framework, responsible for interacting with transaction middleware detection target 3, completing the work of filling parameter samples into the protocol template to generate simulation messages, and realizing the sending of simulation messages and the receiving of response messages; transaction middleware detection target 3 is the adaptation layer between the protocol outside the middleware and the protocol inside the middleware, and serves as the proxy service of the transaction middleware listener.
[0055] The embodiment of the present invention adds a transaction middleware detection target 3 independent of the production environment between the simulation agent 2 and the transaction middleware listener, which can deserialize the simulation message, replace the input parameters, enhance the readability of the simulation message, and facilitate the business statistics of the protocol.
[0056] In the embodiment of the present invention, Figure 1 The simulation proxy call system provided is also used to execute Figure 2 or Figure 3 The simulation proxy calling method shown will not be repeated here.
[0057] In the scheme of the embodiment of the present invention, a user request is obtained, and the user request includes a simulation message; the simulation message is verified; if the verification passes, the generated first interface service is initialized to generate a second interface service; the second interface service is called, and a calling result is generated according to the simulation message, so as to realize deep monitoring and improve the stability of the monitoring target.
[0058] Figure 2 A flowchart of a simulation proxy calling method provided by an embodiment of the present invention, such as Figure 2 As shown, the method includes:
[0059] Step 101: Obtain a user request, where the user request includes a simulation message.
[0060] Step 102: Verify the simulation message.
[0061] Step 103: If the verification passes, initialize the generated first interface service and generate a second interface service.
[0062] Step 104: call the second interface service and generate a call result according to the simulation message.
[0063] In the technical solution provided by the embodiment of the present invention, a user request is obtained, and the user request includes a simulation message; the simulation message is verified; if the verification passes, the generated first interface service is initialized to generate a second interface service; the second interface service is called, and a calling result is generated according to the simulation message, so as to realize deep monitoring and improve the stability of the monitoring target.
[0064] Figure 3 A flowchart of another simulation proxy calling method provided by an embodiment of the present invention, such as Figure 3 As shown, the method includes:
[0065] Step 201: Get a work process, where the work process includes multiple work threads.
[0066] In the embodiment of the present invention, each step is executed by a server.
[0067] In the embodiment of the present invention, the working process includes the working process of the World Wide Web (Web) engineering middleware. The Web engineering middleware includes but is not limited to Tomcat, Weblogic, Jboss, Jetty, Webshere or Glasshfish.
[0068] Step 202: Take multiple snapshots of each working thread at a set time interval to generate multiple thread information.
[0069] In the embodiment of the present invention, the time interval can be set according to actual needs.
[0070] In the embodiment of the present invention, the thread information includes a site address, and the multiple thread information includes multiple site addresses.
[0071] Step 203: Generate parameter samples according to the information of multiple threads.
[0072] In the embodiment of the present invention, step 203 specifically includes:
[0073] Step 2031: Generate a first interface service according to multiple thread information, where the first interface service includes a first key point and a second key point.
[0074] In the embodiment of the present invention, multiple site addresses in multiple thread information are compared to find the site address with the largest number; the site address with the largest number is determined as the function entry for the transaction layer to access the client component, namely: the first interface service.
[0075] In the embodiment of the present invention, the first key point is the interface service initialization node, and the second key point is the interface service calling node.
[0076] Furthermore, the first interface service also includes a core class. The core class is decompiled to generate a decompiled program; errors in the decompiled program are patched to generate patched program code, such as generic errors and nested class errors; the patched program code is copied to the set simulation proxy project, and the simulation proxy project is compiled to generate a simulation proxy. If a dependent package is missing during the compilation process, the dependent package is extracted from the production environment and the compilation continues. The production environment includes multiple dependent packages.
[0077] In the embodiment of the present invention, two application packages need to be generated when compiling the simulation agent project, the first one is used to map the user request to a specific function entry; the second one is used to support the independent process. Only one set of program code is maintained. When the simulation agent receives the user request, it will immediately start the independent simulation subprocess. In order to avoid resource contention and configuration conflicts between threads, consider starting an independent process for each simulation probe.
[0078] Furthermore, a configuration file is obtained, the configuration file including but not limited to one of the first transaction gateway address, the middleware access password and the area code or any combination thereof; and the configuration file is stored in the first interface service.
[0079] Step 2032: extract the first characteristic parameter from the first key point.
[0080] Step 2033: extract the second characteristic parameter from the second key point.
[0081] Step 2034: patch the first characteristic parameter and the second characteristic parameter through the bytecode manipulation framework (ASM) to generate a parameter sample.
[0082] In the embodiment of the present invention, the first characteristic parameter and the second characteristic parameter are input into the ASM, and a parameter sample is output.
[0083] Furthermore, the parameter samples are stored in the production environment.
[0084] In the embodiment of the present invention, the first interface service is patched by ASM to generate parameter samples, so that the production environment can be safely patched when decompilation or source code cannot be obtained.
[0085] In the embodiment of the present invention, after the transaction gateway client module is transplanted, the simulation agent needs to be further patched to realize the functions of configuration file removal, connection reset, connection recovery, independent process scheduling and independent thread scheduling.
[0086] Figure 4 A schematic diagram of building a simulation agent provided by an embodiment of the present invention, such as Figure 4 As shown, the Web project includes core applications and client components. The principle of building a simulation proxy is to separate the client components that call the transaction gateway in the front-end system of the production environment and transplant them into the simulation proxy project to complete the construction of the simulation proxy. The simulation proxy constructed by the embodiment of the present invention can be standardized and can be used to simulate protocols between various systems; except for generating parameter samples, other steps will not cause damage to the production environment, and the security is relatively high; the client component used for transplantation is located at the bottom layer, which is the core of the application, with fewer version iterations. After the transplantation is completed, the calling logic will not change frequently, and the stability is relatively high.
[0087] Step 204: Obtain a user request, where the user request includes a simulation message.
[0088] In the embodiment of the present invention, the parameter sample is filled into the pre-set protocol template to generate the simulation message. The protocol template can be pre-set according to actual needs.
[0089] Step 205, verify the simulation message, if the verification passes, execute step 206; if the verification fails, the process ends.
[0090] In the embodiment of the present invention, the simulation message includes input parameters and input parameter formats corresponding to the input parameters, and it is determined whether the input parameter format is consistent with the standard format. If so, it indicates that the verification is passed and step 206 is executed; if not, it indicates that the verification fails and the process ends.
[0091] In the embodiment of the present invention, the standard format includes but is not limited to an integer type, a Boolean type, or a character type.
[0092] Furthermore, a unified call factory is created according to the transaction middleware type, and the unified call factory is a personalized implementation of different transaction middleware types. The unified call factory includes a first transaction gateway address, and the first transaction gateway address is stored in a thread local variable.
[0093] Furthermore, if the verification passes, the initialization flag is set to True.
[0094] Step 206 , determine whether the first transaction gateway address is the same as the second transaction gateway address, if so, execute step 209 ; if not, execute step 207 .
[0095] In the embodiment of the present invention, each working thread includes thread local variables, and the thread local variables include the second transaction gateway address.
[0096] In an embodiment of the present invention, if it is determined that the first transaction gateway address is the same as the second transaction gateway address, it indicates that the transaction gateway address of the current node has not been switched, and step 209 is continued; if it is determined that the first transaction gateway address is different from the second transaction gateway address, it indicates that the transaction gateway address of the current node has changed, and step 207 is continued.
[0097] In the embodiment of the present invention, the transaction gateway address is transparently transmitted using thread local variables to achieve configuration file transformation.
[0098] Step 207: Destroy the first transaction gateway address.
[0099] In the embodiment of the present invention, destroying the first transaction gateway address indicates that the first transaction gateway address has become invalid.
[0100] Step 208: Determine the second transaction gateway address as the first transaction gateway address.
[0101] In the embodiment of the present invention, the transaction gateway address of the current node is used as the updated first transaction gateway address.
[0102] In the embodiment of the present invention, the transaction gateway address in the simulation agent will change flexibly to meet the needs of cloud protocol simulation. All configurations are loaded for the first time in the client, so the logic of reading the configuration file in the client needs to be overwritten, and the configuration of the function entry needs to be transparently transmitted to the client, and the transparent transmission is achieved using thread local variables.
[0103] Step 209: Generate a second interface service, where the second interface service includes the first transaction gateway address.
[0104] In the embodiment of the present invention, the second interface service is regenerated according to the updated first transaction gateway address.
[0105] Step 210: Deserialize the simulation message to generate a first editable object.
[0106] In the embodiment of the present invention, deserialization refers to the process of converting a byte sequence into an editable object. The object can be reconstructed through deserialization according to the object state and description information stored in the byte stream.
[0107] Step 211: Modify the first editable object to generate a second editable object.
[0108] In the embodiment of the present invention, the first editable object can be modified according to actual needs, for example, parameters can be supplemented or parameters can be modified.
[0109] Step 212: Serialize the second editable object to generate an updated simulation message.
[0110] In the embodiment of the present invention, serialization refers to the process of converting an editable object into a byte sequence, which can ensure the integrity and transferability of the editable object when transferring and saving the editable object. The editable object is converted into an ordered byte stream so that it can be transmitted on the network or saved to a local file.
[0111] Step 213: call the second interface service and generate a call result according to the simulation message.
[0112] In the embodiment of the present invention, the call result includes an input stream, an error stream and an output stream. The data type of the data of the output stream is an integer. If the data of the output stream is 0, it means that the call is successful, and the input parameter in the input stream is read. At this time, the error stream displays a null value; if the data of the output stream is 1, it means that the call fails, and the data of the error stream is read.
[0113] Step 214: Destroy the second interface service.
[0114] In the embodiment of the present invention, step 214 specifically includes:
[0115] Step 2141, set the initialization flag to False.
[0116] Step 2142, destroy the unified call factory.
[0117] In the embodiment of the present invention, the use of independent thread scheduling can solve the problem of high overhead of some processes, and a method of destroying the interface service is added to avoid process backlog. Destroying the interface service will not destroy the client object, but can only destroy a series of derived objects, including clearing all connections to the transaction gateway to avoid connection leakage. After the destruction is completed, it marks the end of a complete protocol simulation.
[0118] In the embodiment of the present invention, the simulation proxy calling process is not limited to the protocol simulation of the system Web layer, but can go deep into the transaction middleware layer and cover all nodes in the cloud, realizing large-scale stateless protocol simulation, and thus having the ability to foresee and quickly troubleshoot faults.
[0119] In the technical solution of the simulation proxy calling method provided in the embodiment of the present invention, a user request is obtained, and the user request includes a simulation message; the simulation message is verified; if the verification passes, the generated first interface service is initialized to generate a second interface service; the second interface service is called, and a calling result is generated according to the simulation message, which can realize deep monitoring and improve the stability of the monitoring target.
[0120] Figure 5 A schematic diagram of the structure of a simulation proxy calling device provided by an embodiment of the present invention, the device is used to execute the above simulation proxy calling method, such as Figure 5 As shown, the device includes: a first acquiring unit 11, a first generating unit 12, a second generating unit 13 and a third generating unit 14.
[0121] The first acquiring unit 11 is used to acquire a user request, where the user request includes a simulation message.
[0122] The first generating unit 12 is used to verify the simulation message.
[0123] The second generating unit 13 is used to initialize the generated first interface service and generate a second interface service if the verification passes.
[0124] The third generating unit 14 is used to call the second interface service and generate a calling result according to the simulation message.
[0125] In the embodiment of the present invention, the device further includes: a second acquiring unit 15 , a fourth generating unit 16 , a fifth generating unit 17 and a sixth generating unit 18 .
[0126] The second acquisition unit 15 is used to acquire a working process, where the working process includes multiple working threads.
[0127] The fourth generating unit 16 is used to take multiple snapshots of each working thread at a set time interval to generate multiple thread information.
[0128] The fifth generating unit 17 is used to generate parameter samples according to the multiple thread information.
[0129] The sixth generating unit 18 is used to write the parameter sample into the set protocol template to generate a simulation message.
[0130] In an embodiment of the present invention, the fifth generation unit 17 is specifically used to generate a first interface service based on multiple thread information, the first interface service including a first key point and a second key point; extract a first characteristic parameter from the first key point; extract a second characteristic parameter from the second key point; and patch the first characteristic parameter and the second characteristic parameter through a bytecode manipulation framework to generate a parameter sample.
[0131] In an embodiment of the present invention, the second generation unit 13 is specifically used to determine whether the first transaction gateway address is the same as the second transaction gateway address; if it is determined that the first transaction gateway address is different from the second transaction gateway address, destroy the first transaction gateway address; determine the second transaction gateway address as the first transaction gateway address; generate a second interface service, and the second interface service includes the first transaction gateway address.
[0132] In the embodiment of the present invention, the device further includes a storage unit 19 .
[0133] The storage unit 19 is used to store the first transaction gateway address into the thread local variable.
[0134] In the embodiment of the present invention, the device further includes: a seventh generating unit 20 , an eighth generating unit 21 , a ninth generating unit 22 and a tenth generating unit 23 .
[0135] The seventh generating unit 20 is used to deserialize the simulation message to generate a first editable object.
[0136] The eighth generating unit 21 is used to modify the first editable object to generate a second editable object.
[0137] The tenth generating unit 23 is used to serialize the second editable object to generate an updated simulation message.
[0138] In the embodiment of the present invention, the device further includes a destroying unit 24 .
[0139] The destroying unit 24 is used to destroy the second interface service.
[0140] In the scheme of the embodiment of the present invention, a user request is obtained, and the user request includes a simulation message; the simulation message is verified; if the verification passes, the generated first interface service is initialized to generate a second interface service; the second interface service is called, and a calling result is generated according to the simulation message, so as to realize deep monitoring and improve the stability of the monitoring target.
[0141] An embodiment of the present invention provides a storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the steps of the embodiment of the above-mentioned simulation agent calling method. For a specific description, please refer to the embodiment of the above-mentioned simulation agent calling method.
[0142] An embodiment of the present invention provides a computer device, including a memory and a processor, the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and when the program instructions are loaded and executed by the processor, the steps of the embodiment of the above-mentioned simulation agent calling method are implemented. For a specific description, please refer to the embodiment of the above-mentioned simulation agent calling method.
[0143] Figure 6 A schematic diagram of a computer device provided by an embodiment of the present invention. Figure 6 As shown, the computer device 30 of this embodiment includes: a processor 31, a memory 32, and a computer program 33 stored in the memory 32 and executable on the processor 31. When the computer program 33 is executed by the processor 31, the simulation agent calling method in the embodiment is implemented. To avoid repetition, it is not described one by one here. Alternatively, when the computer program is executed by the processor 31, the functions of each model / unit in the simulation agent calling device in the embodiment are implemented. To avoid repetition, it is not described one by one here.
[0144] The computer device 30 includes, but is not limited to, a processor 31 and a memory 32. Those skilled in the art will appreciate that Figure 6 This is only an example of the computer device 30 and does not constitute a limitation of the computer device 30. The computer device 30 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0145] The processor 31 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0146] The memory 32 may be an internal storage unit of the computer device 30, such as a hard disk or memory of the computer device 30. The memory 32 may also be an external storage device of the computer device 30, such as a plug-in hard disk, a smart storage (Smart Media, SM) card, a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 30. Further, the memory 32 may also include both an internal storage unit of the computer device 30 and an external storage device. The memory 32 is used to store computer programs and other programs and data required by the computer device. The memory 32 may also be used to temporarily store data that has been output or is to be output. In several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, which may be electrical, mechanical or other forms.
[0147] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0148] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0149] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A simulation proxy calling method, It is characterized in that The method comprises: Obtaining a user request, wherein the user request includes a simulation message; Verifying the simulation message; If the verification passes, the generated first interface service is initialized to generate a second interface service; Calling the second interface service, and generating a calling result according to the simulation message; The first interface service includes a first transaction gateway address, each worker thread includes a thread local variable, and the thread local variable includes a second transaction gateway address; The step of initializing the generated first interface service to generate the second interface service includes: Determining whether the first transaction gateway address is the same as the second transaction gateway address; If it is determined that the first transaction gateway address is different from the second transaction gateway address, destroying the first transaction gateway address; Determine the second transaction gateway address as the first transaction gateway address; The second interface service is generated, wherein the second interface service includes the first transaction gateway address.
2. The method according to claim 1, It is characterized in that Before obtaining the user request, the method further includes: Obtain a work process, where the work process includes multiple work threads; Taking multiple snapshots of each of the working threads at set time intervals to generate multiple thread information; Generate parameter samples according to the plurality of thread information; The parameter sample is written into the set protocol template to generate a simulation message.
3. The method according to claim 2, It is characterized in that The generating a parameter sample according to the plurality of thread information includes: Generate the first interface service according to the plurality of thread information, wherein the first interface service includes a first key point and a second key point; Extracting a first characteristic parameter from the first key point; Extracting a second feature parameter from the second key point; The first characteristic parameter and the second characteristic parameter are patched by using a bytecode manipulation framework to generate a parameter sample; The first key point is the first interface service initialization node, and the second key point is the first interface service call node.
4. The method according to claim 1, It is characterized in that Before determining whether the first transaction gateway address is the same as the second transaction gateway address, the method further includes: The first transaction gateway address is stored in the thread local variable.
5. The method according to claim 1, It is characterized in that Before calling the second interface service and generating a calling result according to the simulation message, the method further includes: Deserializing the simulation message to generate a first editable object; Modifying the first editable object to generate a second editable object; The second editable object is serialized to generate an updated simulation message.
6. The method according to claim 1, It is characterized in that After calling the second interface service and generating a calling result according to the simulation message, the method further includes: Destroy the second interface service.
7. A simulation proxy calling device, It is characterized in that The device comprises: A first acquisition unit, configured to acquire a user request, wherein the user request includes a simulation message; A first generating unit, used for verifying the simulation message; A second generating unit is used to initialize the generated first interface service and generate a second interface service if the verification passes; A third generating unit, used for calling the second interface service and generating a calling result according to the simulation message; The first interface service includes a first transaction gateway address, each worker thread includes a thread local variable, and the thread local variable includes a second transaction gateway address; The second generation unit is specifically used to determine whether the first transaction gateway address is the same as the second transaction gateway address; if it is determined that the first transaction gateway address is different from the second transaction gateway address, destroy the first transaction gateway address; determine the second transaction gateway address as the first transaction gateway address; generate a second interface service, and the second interface service includes the first transaction gateway address.
8. A storage medium, It is characterized in that The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the simulation agent calling method according to any one of claims 1 to 6.
9. A computer device comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions. It is characterized in that When the program instructions are loaded and executed by the processor, the simulation agent calling method described in any one of claims 1 to 6 is implemented.
