A testing method, related device and equipment for a target test stub service

By receiving and loading the intermediate code of the priority loading identifier, the target code is generated, which solves the problem that the test pile service cannot handle encrypted packets, and realizes the secure access to the target test pile service and reduces costs.

CN116137601BActive Publication Date: 2025-07-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111363566.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-17
Publication Date
2025-07-25
Estimated Expiration
2041-11-17

AI Technical Summary

Technical Problem

In the prior art, the test pile service cannot simulate the target service server processing encrypted or signed messages, which makes it difficult to transform the test pile service to crack the service server encryption algorithm, and increases the cost of accessing the test pile service.

Method used

By receiving the test request of the target test pile service, the first intermediate code and the second intermediate code carrying the priority loading identifier are obtained, the target code is loaded according to the priority loading identifier order, and the test query message is sent to the target test pile service for processing, simulating the logical processing of the target service server.

Benefits of technology

There is no need to renovate the test pile service, which reduces the cost consumption of manpower, financial resources and technical support, and realizes the secure access to the target test pile service and processes test query messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116137601B_ABST
    Figure CN116137601B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a test method, related devices and equipment for a target test stub service. The related embodiments can be applied to various scenarios such as cloud technology and artificial intelligence to improve the security of accessing the test stub service and reduce the access cost. The method of the embodiments of the present application includes: receiving a test request for the target test stub service, obtaining a first intermediate code and a second intermediate code, where the first intermediate code carries a priority loading identifier, includes a first function name and first bytecode corresponding to the first function name, loading the first intermediate code and the second intermediate code according to the sequence of the priority loading identifiers to obtain a target code, executing the target code, when receiving a test query message, sending the test query message to the target test stub service for processing according to the target test stub service address in the target code, and if a response message returned by the target test stub service is received, the test of the target test stub service is successful.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of network security management, and in particular, to a test method, related device and equipment for a target test stub service. Background Art

[0002] With the rapid development of Internet information, more and more Internet services have brought convenience to people's lives. Therefore, each business object, such as an enterprise, can achieve the docking between the financial system of the business object and the integrated business system of the business server through the Internet or dedicated line connection. However, the business service can only be launched after passing the test in the business service test environment. The target business server can open a formal production environment for business objects to perform business transactions, business inquiries, business fund details and other business services. Therefore, in order to maintain the stability of the business service test environment, usually, a test stub service is accessed to simulate the business server to process the message data sent by the business object.

[0003] However, due to business security requirements, security communication is usually achieved between the business object and the business server by using encryption algorithms provided by the business server, such as signature encryption. However, the test stub service cannot directly simulate the target business server to identify or process the encrypted or signed message. Generally, the test stub service can be modified to be a test stub service that can crack various encryption algorithms of the business server, so that the modified test stub service can identify and process the received message data after encryption and signature. However, it is difficult to crack the encryption algorithm of the business server, which requires high-cost human, financial and technical support, resulting in an increase in the cost of accessing the test stub service. Summary of the Invention

[0004] The embodiments of the present application provide a test method, related device and equipment for a target test stub service, which are used to securely access the target test stub service through the target test stub service address, and send the received test query message to the target test stub service through the test stub service address to simulate the target business server for processing, without modifying the test stub service, which can reduce the consumption of human, financial and technical support costs, thereby reducing the cost of accessing the test stub service.

[0005] On the one hand, the embodiments of the present application provide a test method for a target test stub service, including:

[0006] Receiving a test request for the target test stub service;

[0007] Obtain a first intermediate code and a second intermediate code according to a test request, where the first intermediate code carries a preloading identifier, the first intermediate code includes a first function name and a first bytecode corresponding to the first function name, the first bytecode includes a target test stub service address, and the second intermediate code is obtained by compiling the business code of the target service;

[0008] Load the first intermediate code and the second intermediate code according to the sequence of the preloading identifiers to obtain a target code;

[0009] Execute the target code. When a test query message of the target service is received, send the test query message to the target test stub service for processing according to the target test stub service address in the target code;

[0010] If a response message returned by the target test stub service is received, the test of the target test stub service is successful.

[0011] On the other hand, the present application provides a test device for a target test stub service, including:

[0012] A receiving unit, configured to receive a test request for the target test stub service;

[0013] An obtaining unit, configured to obtain a first intermediate code and a second intermediate code according to the test request, where the first intermediate code carries a preloading identifier, the first intermediate code includes a first function name and a first bytecode corresponding to the first function name, the first bytecode includes a target test stub service address, and the second intermediate code is obtained by compiling the business code of the target service;

[0014] A processing unit, configured to load the first intermediate code and the second intermediate code according to the sequence of the preloading identifiers to obtain a target code;

[0015] The processing unit is further configured to execute the target code. When a test query message of the target service is received, send the test query message to the target test stub service for processing according to the target test stub service address in the target code;

[0016] The receiving unit is further configured to, if a response message returned by the target test stub service is received, the test of the target test stub service is successful.

[0017] In a possible design, in an implementation manner on the other hand of the embodiments of the present application, the processing unit may specifically be configured to:

[0018] Preferentially load the first intermediate code according to the sequence of the preloading identifiers;

[0019] When loading the second intermediate code after the first intermediate code is loaded, filter the second intermediate code according to the first function name to obtain the local second intermediate code that is different from the first function name;

[0020] Load the local second intermediate code to obtain the target code.

[0021] In a possible design, in an implementation manner of another aspect of the embodiments of the present application, the processing unit may specifically be used for:

[0022] After the first intermediate code is loaded, load the second intermediate code according to the first function name. If a second function name identical to the first function name is identified in the second intermediate code, ignore the second function name and the second bytecode corresponding to the second function name;

[0023] If a second function name different from the first function name is identified in the second intermediate code, use the second function name and the second bytecode corresponding to the second function name as the local second intermediate code.

[0024] In a possible design, in an implementation manner of another aspect of the embodiments of the present application, the obtaining unit may specifically be used for:

[0025] Download the first intermediate code according to the first test identifier;

[0026] Download the service code according to the second test identifier, and compile the service code according to the second function name to obtain the second intermediate code.

[0027] In a possible design, in an implementation manner of another aspect of the embodiments of the present application, the processing unit may specifically be used for:

[0028] Execute the target code. When a test query message for the target service is received, process the test query message into a test query plaintext according to the target code;

[0029] Send the test query plaintext to the target test stub service corresponding to the target test stub service address for processing.

[0030] In a possible design, in an implementation manner of another aspect of the embodiments of the present application,

[0031] The processing unit is further configured to update the target code to the second intermediate code and execute the second intermediate code;

[0032] The processing unit is further configured to, when a target service message is received, send the target service message to the target service server for processing according to the target service server interface address in the second intermediate code.

[0033] In a possible design, in an implementation of another aspect of the embodiments of the present application, the processing unit may specifically be used for:

[0034] When receiving a target service message, process the target service message into a target service ciphertext according to the encryption algorithm corresponding to the target service server interface in the second intermediate code;

[0035] Send the target service ciphertext to the target service server corresponding to the target service server interface address for processing.

[0036] Another aspect of the present application provides a computer device, including: a memory, a transceiver, a processor, and a bus system;

[0037] Wherein, the memory is used to store programs;

[0038] The processor is used to implement the methods in the above aspects when executing the programs in the memory;

[0039] The bus system is used to connect the memory and the processor to enable the memory and the processor to communicate.

[0040] Another aspect of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions run on a computer, the computer is enabled to execute the methods in the above aspects.

[0041] One aspect of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for determining the text category provided in any of the above aspects.

[0042] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0043] By receiving a test request for a target stub service, obtaining a first intermediate code and a second intermediate code carrying a priority loading identifier according to the test request, loading the first intermediate code and the second intermediate code according to the order of the priority loading identifiers to obtain a target code, and then executing the target code. When a test query message of a target service is received, the test query message is sent to the target stub service for processing according to the target stub service address in the target code. When a response message returned by the target stub service is received, the test of the target stub service is successful. Through the above method, the first intermediate code can be used to replace the second intermediate code with the same first function name through the priority loading identifier to obtain the target intermediate code, so that when the target code is executed, the target stub service can be safely accessed through the target stub service address, and the received test query message can be sent to the target stub service through the stub service address to simulate the target business server for processing without modifying the stub service, which can reduce the consumption of human, financial and technical support costs, thereby reducing the cost of accessing the stub service. Description of the Drawings

[0044] Figure 1 is a schematic architecture diagram of a data control system in an embodiment of the present application;

[0045] Figure 2 is another schematic architecture diagram of a data control system in an embodiment of the present application;

[0046] Figure 3 is an interaction schematic diagram of a data control system in an embodiment of the present application;

[0047] Figure 4 is a flowchart of an embodiment of a test method for a target stub service in an embodiment of the present application;

[0048] Figure 5 is a schematic diagram of a principle process of a test method for a target stub service in an embodiment of the present application;

[0049] Figure 6 is a schematic diagram of a test environment of a test method for a target stub service in an embodiment of the present application;

[0050] Figure 7 is a schematic diagram of an embodiment of a test device for a target stub service in an embodiment of the present application;

[0051] Figure 8 is a schematic diagram of an embodiment of a computer device in an embodiment of the present application. Detailed Embodiments

[0052] The embodiments of the present application provide a test method, related devices and equipment for a target test stub service, which are used to securely access the target test stub service through the target test stub service address, and send the received test query message to the target test stub service through the test stub service address to simulate a target business server for processing. Without modifying the test stub service, it can reduce the consumption of human, financial and technical support costs, thereby reducing the cost of accessing the test stub service.

[0053] The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of the present application are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "corresponding to" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily limit to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0054] With the rapid development of information, cloud technology has gradually penetrated into all aspects of people's lives. Cloud technology is the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, be used on demand, and is flexible and convenient. Cloud computing technology will become an important support. The back-end services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark and needs to be transmitted to the back-end system for logical processing. Data at different levels will be processed separately, and various industry data requires a powerful system back-end support, which can only be achieved through cloud computing.

[0055] Among them, cloud security refers to the general term for security software, hardware, users, organizations, and security cloud platforms based on the cloud computing business model. Cloud security integrates emerging technologies and concepts such as parallel processing, grid computing, and unknown virus behavior judgment. Through the abnormal monitoring of software behavior in the network by a large number of clients in a mesh network, it obtains the latest information about Trojans and malicious programs on the Internet, and sends it to the server for automatic analysis and processing, and then distributes the solutions for viruses and Trojans to each client. The test method for the target test stub service provided by the embodiments of the present application can be implemented through cloud computing technology and cloud security technology.

[0056] It should be understood that the test method of the target test stub service provided by this application can be applied to fields such as cloud technology, artificial intelligence, and intelligent transportation, and is used in scenarios where the business server is simulated through the test stub service to process message data to provide standardized business services for business objects. As an example, for instance, the test stub service simulates a bank's processing of a fund query message to provide a fund query business service for enterprise customers; as another example, for instance, the test stub service simulates a securities company's processing of a held securities query message to provide a held securities query business service for the query object; for example, for instance, the test stub service simulates an information management system's processing of an information query message to provide an information query business service for the query object. In all these scenarios, in order to access the test stub service to simulate the business server, it is usually necessary to transform the test stub service, and the test stub service needs to be transformed into a test stub service that can crack various encryption algorithms of the business server, so that the transformed test stub service can identify and process the received message data after encrypted signature. However, it is difficult to crack the encryption algorithm of the business server, and it requires high-cost human, financial, and technical support, resulting in an increase in the cost of accessing the test stub service.

[0057] To solve the above problems, this application proposes a test method for a target test stub service, and this method is applied to Figure 1 the data control system shown. Please refer to Figure 1 , Figure 1 which is an architecture schematic diagram of the data control system in an embodiment of this application. As shown in Figure 1 , the application server receives a test request for the target test stub service from the terminal device, and obtains a first intermediate code and a second intermediate code carrying a priority loading identifier according to the test request. According to the order of the priority loading identifier, the first intermediate code and the second intermediate code are loaded to obtain the target code. Then, the target code is executed. When a test query message of the target business is received, the test query message is sent to the target test stub service for processing according to the target test stub service address in the target code. And when a response message returned by the target test stub service is received, the test of the target test stub service is successful. Through the above method, it is possible to use the priority loading identifier to replace the second intermediate code with the same first function name by the first intermediate code to obtain the target intermediate code, so that when the target code is executed, the target test stub service can be safely accessed through the target test stub service address, and the received test query message can be sent to the target test stub service through the test stub service address to simulate the target business server for processing, without transforming the test stub service, which can reduce the consumption of human, financial, and technical support costs, thereby reducing the cost of accessing the test stub service.

[0058] Among them, the application server is communicatively connected to the terminal device, and the application server is communicatively connected to the test stub service. Specifically, the application server and the test stub service can be integrated on the same server or can be two separate and independent servers. It should be understood that Figure 1 The number of the target terminal device, application server, and test stub service shown in

[0059] is only an example and is not used to limit the number of the target terminal device, application server, and test stub server. The specific number should be flexibly determined according to the actual situation. Figure 2 , Figure 2 Refer to Figure 2 for another schematic diagram of the architecture of the data control system in the embodiment of the present application, which includes a target terminal device, an application server, and a test stub service. It can be understood that Figure 2 only shows one type of terminal device. In actual scenarios, more types of terminal devices can participate in the data processing process. The terminal devices include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, in-vehicle terminals, etc. The specific number and types depend on the actual scenario and are not limited here. Additionally, Figure 2 only shows one server in

[0060] . However, in actual scenarios, multiple servers can also participate. Especially in the scenario of multi-model training interaction, the number of servers depends on the actual scenario and is not limited here.

[0060] It should be noted that in this embodiment, the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms. The terminal device and the server can be directly or indirectly connected through wired or wireless communication methods. The terminal device and the server can be connected to form a blockchain network, which is not limited in this application.

[0061] To solve the above problems, the present application proposes a test method for a target test stub service. This method is generally executed by a server or a terminal device. Correspondingly, a test device for the target test stub service is generally set in the server or the terminal device.

[0062] It can be understood that, for the test method, related devices, and equipment of the target test stub service disclosed in this application, multiple servers or terminal devices can form a blockchain, and the servers or terminal devices are nodes on the blockchain. In practical applications, data sharing between nodes may be required in the blockchain, and code data, etc. can be stored on each node.

[0063] For ease of understanding, please refer to Figure 3 , Figure 3 which is an interaction schematic diagram of the data control system in an embodiment of this application. As Figure 3 shown, in step S1, that is, when the test transaction of the test stub service starts, when a business object wants to access a target business server through an application server to perform a business service, that is, to enable the target business server to open a production environment through the application server to perform business transactions, business inquiries, or business fund details, etc. business services. In this case, the test stub service can be accessed through the application server to simulate the target business server to process the business service message sent by the business object. Therefore, in order to verify whether the test stub service can simulate a certain business ability of the target business server, a test request for the target test stub service can be sent to the application server through a terminal device.

[0064] In step S2, that is, during the test transaction of the test stub service, upon receiving the test request for the target test stub service, the application server can receive the stub device program uploaded by the developer or tester, and can compile the code in the obtained stub device program into the first intermediate code according to the preset function naming specification. At the same time, the application server can add the preset function naming specification to the Software Development Kit (SDK), and can download the business code from the front-end device, and compile the obtained business code into the second intermediate code through the SDK. Then, the application server can load the first intermediate code and the second intermediate code into the target code through an interpreter. When the target code runs in the operating system of the application server, the developer or tester can simulate the business object to send a test query message to the application server. At this time, the application server can be composed of one or more physical servers, and the specific number is not limited here. Among them, the physical server can specifically be manifested as a test server for controlling the code operation. The application server can perform logical processing on the test query message according to the running target code, and can obtain the test query plaintext recognizable by the target test stub service. Then, the target test stub service can be accessed through the target test stub service address in the target code, and the test query plaintext can be sent to the target test stub service through the network communication protocol, so that the target test stub service can simulate the processing ability of the target business server to recognize and process the received test query plaintext.

[0065] In step S3, that is, in the test transaction response of the test stub service, the developer or tester can, according to the SDK port, corresponding logic algorithm, and processing example provided in advance by the target business server, configure a response message corresponding to the logic processing result in the target test stub service. When the target test stub service receives the test query plaintext sent by the application server through the network communication protocol, the target test stub service can identify the received test query plaintext, and can simulate the target business server to perform corresponding logic processing on the test query plaintext according to the service capabilities of the obtained SDK port to obtain the logic processing result. Then, the target test stub service can obtain the corresponding response message according to the logic processing result, and send the response message to the application server through the network communication protocol.

[0066] In step S4, that is, when the test transaction of the test stub service ends, when the application server receives the response message fed back by the target stub service, it can perform corresponding logic processing on the received response message according to the target code, and send the processed response message to the target terminal device, that is, it can successfully access the target test stub service with the application server, and the target test stub service can simulate the target business server to process the test query message and return the corresponding processing result, indicating that the test of the test stub service is successful, and the application server has the ability to access the target business server.

[0067] In step S5, that is, during the access service of the target business server, when the test transaction of the test stub service ends, it can be understood that the application server accesses the target business server for the performance stability of a certain business service. Therefore, the target business server can open the production environment corresponding to this business service for the business object through the application server, so that the business object can access the target business server through the application server to carry out this business service. In this case, for this business service, the business object can send a target business message to the application server through the terminal device, and the application server performs corresponding logic processing on the received target business message, such as message encryption or signature verification, etc.

[0068] In step S6, that is, when the access service of the target business server ends, after the application server performs corresponding logic processing on the received target business message, the application server can access the target business server through the corresponding SDK port, and send the processed target business message to the target business server for processing through the network communication protocol, so that the processing result can be returned to the business object through the application server subsequently.

[0069] The test method of the target test stub service in this application will be introduced below. Please refer to Figure 4 and Figure 5 、 Figure 6, an embodiment of the test method for the target test stub service in the embodiments of the present application includes:

[0070] In step S101, receive a test request for the target test stub service;

[0071] In this embodiment, when a tester or a caller wants to test or verify whether an application server has the ability to provide business services for business objects, it can be reflected by testing whether the test stub service of the application server can simulate the target business server. Therefore, the tester or the caller can send a test request for the target test stub service to the application server through a terminal device, so that relevant data can be obtained according to the test request to test the target test stub service subsequently.

[0072] Specifically, the target test stub service can specifically be a mock test stub service, or it can also be other test stub services, such as a stub test stub service. There is no specific limitation here. It can be understood that the target test stub service in this embodiment is described by taking the mock test stub service as an example. Among them, the mock test stub service can be used to simulate the result of a test. However, the mock test stub service can only identify and process plaintext. The mock test stub service mainly refers to the puppet of a certain program, that is, a false program, which can respond according to the tester's wishes and return the information that the object under test needs to obtain, so that the mock test stub service can be a fake object that simulates the behavior of a real object in a controllable manner. For example, a car designer uses a crash test dummy to simulate the dynamic behavior of a person in a vehicle collision. The application server can specifically be a bank-enterprise payment product, a securities delivery center, or a student status information query platform, etc., or it can also be other servers. There is no specific limitation here. Among them, the bank-enterprise payment product can be used to aggregate the fund payment capabilities of multiple target business servers, shield the differences between each target business server, and provide standardized payment and collection services or fund query services, etc., for the business counterpart. The target business server can specifically be a bank, a securities company, or an information management system, etc., or it can also be other servers. There is no specific limitation here. The business object can specifically be an enterprise, an ordinary individual user, or a community, etc., or it can also be other objects. There is no specific limitation here.

[0073] For example, when a tester wants to verify whether the application server can access the function of querying the total amount of funds, the tester can send a test request for the target test stub service corresponding to the function of querying the total amount of funds to the application server through a terminal device.

[0074] In step S102, a first intermediate code and a second intermediate code are obtained according to a test request. The first intermediate code carries a preloading identifier and includes a first function name and first bytecode corresponding to the first function name. The first bytecode includes a target test stub service address. The second intermediate code is obtained by compiling the business code of the target service.

[0075] In this embodiment, as Figure 5 shown, when a test request for the target test stub service is received, the first intermediate code and the second intermediate code can be obtained according to the test request, so that the obtained first intermediate code and second intermediate code can be processed subsequently to accurately access the target test stub service.

[0076] Specifically, as Figure 6 shown, when a test request for the target test stub service is received, the application server can receive the stub device program code uploaded by developers or testers, and can compile the code in the obtained stub device program into the first intermediate code according to a preset function naming specification. At the same time, the application server can add the preset function naming specification to the software development kit (SDK), and then can download the business code from the front-end device and compile the obtained business code into the second intermediate code through the SDK.

[0077] Among them, the stub device program code is the code that can perform corresponding logical processing on message data in the corresponding logical processing link. Specifically, as shown in Table 1, the first intermediate code is the binary code obtained by compiling the stub device program code through a compiler according to a preset first function name, so that the obtained message data can be processed into plaintext data recognizable by the target stub service according to the first bytecode corresponding to each first function name. The front-end device can specifically be a front-end machine, which can be connected to a direct connection gateway, such as a bank enterprise direct connection gateway, and can implement communication protocol message conversion for the target business server and perform differential logical processing on the communication protocol message, so as to obtain a standard interface that passes the test and provide it to the upper-layer service. The preloading identifier (identity, ID), used to indicate the code that can be preferentially recognized and loaded, can specifically be represented as a digital string of the integer (int) type, or can also be specifically represented as a string, etc.

[0078] Table 1

[0079]

[0080] It can be understood that the function name in the second intermediate code may only contain a second function name that is the same as the first function name, or may contain a second function name and other function names. Among them, the second function name corresponds to second bytecode. Since the second intermediate code is compiled based on the program in the front-end machine, and the program of the front-end machine can be compiled based on the bank enterprise direct connection client SDK, the second bytecode therein can be manifested as encrypting the message according to the SDK encryption algorithm, or verifying the signature of the message according to the SDK signature verification method, or the message communication address is the target service server interface address, such as the SDK port, etc. It can also be other bytecodes, which are not specifically limited herein.

[0081] In step S103, according to the sequence of the priority loading identifiers, the first intermediate code and the second intermediate code are loaded to obtain the target code;

[0082] In this embodiment, as Figure 5 shown, after obtaining the first intermediate code, the second intermediate code, and the priority loading identifier, the first intermediate code can be preferentially loaded. While continuing to load the second intermediate code, the loading condition of only retaining the unique function name can be used to obtain the target code, so that the obtained target code can be quickly and accurately connected to the target test stub service in the subsequent operation. Among them, the target code includes the first intermediate code and the partial second intermediate code, and the partial second intermediate code is the code in the second code corresponding to the function name different from the first function name.

[0083] Specifically, when the first intermediate code, the second intermediate code, and the priority loading identifier are obtained, the first intermediate code and the second intermediate code can be input into the interpreter, and according to the interpreter, it can be compiled and run while, and the already loaded function names and bytecodes are not repeatedly loaded. Only retaining the unique function name and bytecode preferentially loaded, according to the priority loading identifier in the interpreter, the first intermediate code can be preferentially loaded according to the first function name and the first bytecode shown in Table 1. Then, continue to load the second intermediate code. If the already loaded function name, such as the first function name, is recognized, operations such as overwriting, ignoring, or hiding the bytecode of this function name can be performed until the second intermediate code is loaded completely, and the target code can be obtained.

[0084] For example, according to the priority loading identifier, assume that the first intermediate code with the first function name "message encryption" and its corresponding first bytecode "not encrypted" has been loaded in the interpreter. Then, when the second intermediate code with the same second function name "message encryption" as the first function name and the second intermediate code "perform message encryption according to the SDK encryption algorithm" is loaded, the first bytecode "not encrypted" corresponding to the first function name "message encryption" can overwrite "perform message encryption according to the SDK encryption algorithm", so that when the target code is subsequently run and the business message is encrypted, the business message can be logically processed according to the first bytecode "not encrypted".

[0085] In step S104, the target code is executed. When a test query message of the target service is received, the test query message is sent to the target test stub service for processing according to the target test stub service address in the target code.

[0086] In this embodiment, as Figure 5 shown, after the target code is obtained, the target code can be input into the operating system for running. It can be understood that the current application server has established a test environment with the target test stub service. Therefore, it can receive the test query message sent by the developer or the caller, and process the test query message according to each logical processing link of the running target code. The logically processed test query message can be obtained. At the same time, the application server can be directly connected to the target test stub service through the target test stub service address corresponding to the message communication. Then, the logically processed test query message can be sent to the accessed target test stub service for processing through the network protocol without modifying the capabilities of the test stub service, and the test query message can be accurately and quickly sent to the target test stub service for processing, which can reduce the consumption of human, financial and technical support costs, thereby reducing the cost of accessing the test stub service.

[0087] Specifically, as Figure 6 shown, when the operating system can run the target code, it can be understood that the application server has established a test environment with the target test stub service. The developer or tester can pre-configure the response message corresponding to the logical processing result in the target test stub service according to the SDK port, the corresponding logical algorithm and the processing example provided by the target business server, so that the target test stub service can simulate the target business server to process the obtained plaintext.

[0088] Further, when the application server accesses the target test stub service through the target test stub service address, then, according to the network communication protocol, it sends a test query message to the target test stub service, so that the target test stub service can receive the test query message sent by the application server through the network communication protocol. The target test stub service can identify the received test query message and can simulate the target business server according to the service capabilities of the obtained SDK port to perform corresponding logical processing on the test query message to obtain a logical processing result.

[0089] For example, assume that the application server accesses the target test stub service A1 through the target test stub service address 001. If it receives a test query message, the application server can process the test query message according to the target code, such as not encrypting it. Then, through the network communication protocol, such as the http protocol, it sends the unencrypted test query message "Query whether the balance is 200,000 yuan" to the target test stub service A1, so that the target test stub service A1 can simulate the fund query ability of the target business server, such as Bank B, to identify and process the obtained unencrypted test query message "Query whether the balance is 200,000 yuan".

[0090] In step S105, if a response message returned by the target test stub service is received, the test of the target test stub service is successful.

[0091] In this embodiment, when the application server receives the response message fed back by the target stub service, it can be understood that the target test stub service successfully simulates the target business server to process the test query message, that is, the test of the target test stub service is successful.

[0092] Specifically, when the application server receives the response message fed back by the target stub service, the application server can perform corresponding logical processing on the received response message according to the target code and send the processed response message to the target terminal device, so that developers or callers can timely perceive that the test of the target test stub service is successful, that is, the application server can successfully access the target test stub service, and the target test stub service can simulate the target business server to process the test query message, thereby reflecting that the application server has the ability to access the target business server.

[0093] For example, assume that the target test stub service A1 can simulate the fund query ability of the target business server, such as bank B, to identify and process the obtained unencrypted test query message "Query whether the balance is 200,000 yuan". Then, the target test stub service A1 can, according to the pre-configured response message cases, feedback a response message of "Insufficient balance" for messages such as querying funds or querying balance. The target test stub service A1 can send the response message of "Insufficient balance" to the application server, and through the application server, send the response message to the terminal device, so that developers or callers can timely perceive the successful test of the target test stub service.

[0094] It can be understood that if the response message returned by the target test stub service is not received, it can be understood that the target test stub service fails to simulate the target business server to process the test query message, or the target test stub service fails to simulate and identify the test query message and other exceptions, resulting in the failure of the target test stub service test. The application server can send a test failure prompt and the reason for the failure to the terminal device, so that developers or callers can timely modify the exception code according to the test failure prompt and the reason for the failure, or maintain the target test stub service.

[0095] In an embodiment of the present application, a test method for a target test stub service is provided. Through the above method, the first intermediate code can be replaced with the second intermediate code having the same first function name by preferentially loading the identifier to obtain the target intermediate code. When the target code is executed, the target test stub service can be safely accessed through the target test stub service address, and the received test query message can be sent to the target test stub service through the test stub service address to simulate the target business server for processing. There is no need to transform the test stub service, which can reduce the consumption of human, financial, and technical support costs, thereby reducing the cost of accessing the test stub service.

[0096] Optionally, on the basis of the above Figure 4 In another optional embodiment of the test method for the target test stub service provided in the embodiment of the present application, according to the order of the preferential loading identifiers, the first intermediate code and the second intermediate code are loaded to obtain the target code, including:

[0097] According to the order of the preferential loading identifiers, the first intermediate code is preferentially loaded;

[0098] When the second intermediate code is loaded after the first intermediate code is loaded, a filtering operation is performed on the second intermediate code according to the first function name to obtain the local second intermediate code different from the first function name;

[0099] The local second intermediate code is loaded to obtain the target code.

[0100] In this embodiment, as Figure 6 shown, after obtaining the first intermediate code, the second intermediate code, and the priority loading flag, the first intermediate code can be preferentially loaded. If, after the first intermediate code is loaded, when continuing to load the second intermediate code, the code different from the first function name can be filtered out from the second intermediate code according to the first function name, that is, the second intermediate code. Then, the filtered local second intermediate code is loaded to obtain the target code, and the code corresponding to the function name identical to the first function name in the second intermediate code can be replaced with the first intermediate code to obtain the target code, so that the subsequent obtained message data can be processed into plaintext data according to the target code, and directly routed to the corresponding target test stub service automatically according to the target test stub service address, and the plaintext data is sent to the target test stub service for processing, thereby being able to maintain the stability of the test environment of the test stub service and reduce the cost of accessing the target test stub service.

[0101] Specifically, after obtaining the first intermediate code, the second intermediate code, and the priority loading flag, both the first intermediate code and the second intermediate code can be input into the interpreter. In the interpreter, according to the priority loading flag, the first intermediate code can be preferentially loaded according to the first function name and the first bytecode shown in Table 1. Then, continue to load the second intermediate code. If a function name identical to the first function name is recognized, the code corresponding to the function name can be filtered out, that is, both the function name and the bytecode corresponding to the function name are filtered out, and only the local second intermediate code different from the first function name is loaded until the loading is completed, and the target code can be obtained.

[0102] For example, according to the priority loading flag, assume that in the interpreter, according to the priority loading flag S01, the first intermediate code corresponding to the priority loading flag S01 is preferentially loaded, such as the first function name "message signature verification" and its corresponding first bytecode "not verified". Then, when the first intermediate code is loaded and then continue to load the second intermediate code, it can be traversed in the function names of the second intermediate code. If a function name identical to the first function name "message signature verification" is recognized, the function name and the bytecode corresponding to the function name "perform message signature verification according to the SDK signature algorithm" can be filtered out.

[0103] Optionally, on the basis of the above Figure 4 corresponding embodiment, in another optional embodiment of the test method for the target test stub service provided by the embodiments of the present application, when loading the second intermediate code after the first intermediate code is loaded, filtering the second intermediate code according to the first function name to obtain the local second intermediate code different from the first function name includes:

[0104] After the first intermediate code is loaded, the second intermediate code is loaded according to the first function name. If a second function name identical to the first function name is recognized in the second intermediate code, the second function name and the second bytecode corresponding to the second function name are ignored.

[0105] If a second function name different from the first function name is recognized in the second intermediate code, the second function name and the second bytecode corresponding to the second function name are used as local second intermediate code.

[0106] In this embodiment, after the first intermediate code is loaded, the second intermediate code can be loaded according to the first function name. If a second function name identical to the first function name is recognized in the second intermediate code, the second function name and the second bytecode corresponding to the second function name are ignored. If a second function name different from the first function name is recognized in the second intermediate code, the second function name and the second bytecode corresponding to the second function name are used as local second intermediate code, so that the target code can be obtained according to the loaded first intermediate code and the subsequently loaded local second intermediate code, enabling the subsequently obtained message data to be processed into plaintext data according to the target code, and directly routing to the corresponding target test stub service according to the target test stub service address, and sending the plaintext data to the target test stub service for processing, thereby maintaining the stability of the test environment of the test stub service and reducing the cost of accessing the target test stub service.

[0107] Specifically, when the interpreter finishes loading the first intermediate code according to the priority loading identifier, the function name of the second intermediate code can be identified according to the first function name that has been loaded. If a second function name identical to the first function name is recognized, the code corresponding to this function name can be ignored, that is, this function name and the bytecode corresponding to this function name are ignored. If a second function name different from the first function name is recognized, the bytecode corresponding to this function name, that is, the local second intermediate code, is loaded and ignored until the loading is complete, and the target code can be obtained.

[0108] For example, according to the priority loading identifier, assuming that after the interpreter loads the first intermediate code, it can continue to load the second intermediate code. According to the principle that the interpreter only recognizes and loads a unique function name, if a second function name identical to the first function name such as "message communication" is recognized, this second function name and the second bytecode corresponding to this second function name such as "target business server SDK port S1" can be ignored. If a second function name different from the first function name such as "message protocol header" is recognized, the second function name and the second bytecode corresponding to this second function name such as "step1" can be loaded to obtain a local second intermediate code.

[0109] Optionally, in the aboveFigure 4 Based on the corresponding embodiments, in another alternative embodiment of the test method for the target test stub service provided by the embodiments of the present application, the test request carries a first test identifier and a second test identifier; obtaining the first intermediate code and the second intermediate code according to the test request includes:

[0110] Download the first intermediate code according to the first test identifier;

[0111] Download the service code according to the second test identifier, and compile the service code according to the second function name to obtain the second intermediate code.

[0112] In this embodiment, when receiving a test request for the target test stub service, the first test identifier and the second test identifier carried by the test request can be obtained, and the first intermediate code corresponding to the first test identifier can be downloaded according to the first test identifier. Then, the service code corresponding to the second test identifier can be retrieved from the pre - installed device corresponding to the second test identifier according to the second test identifier, and the service code can be compiled through the second function name to obtain the second intermediate code. This enables, without intruding into the service code in the pre - installed device during subsequent tests and actual applications, accurate and rapid access to the target test stub service through the replacement of the first intermediate code. This not only reduces the development cost of accessing the test stub service but also avoids financial risks caused by incorrect operations resulting from intruding into the service code in the pre - installed device, thus maintaining the stability of the test environment.

[0113] Among them, the first test identifier can be bound to the target test stub service. When receiving a test request for the target test stub service, it can trigger the application server to remotely download the first intermediate code corresponding to the first test identifier. The first test identifier can be specifically represented as an integer - type digital string or a string, etc. The second test identifier can be bound to the target service code. When receiving a test request for the target test stub service, it can trigger the application server to download the target service code from the pre - installed device storing the target service code corresponding to the second test identifier.

[0114] Specifically, when receiving a test request for the target test stub service, the first test identifier and the second test identifier carried by the test request can be obtained. Then, the application server can send a download request for the first intermediate code to the remote stub device using the first test identifier, and remotely download the first intermediate code corresponding to the first test identifier, which can reduce the cost of manually uploading the first intermediate code in real - time in the test environment, thereby enabling rapid switching to the test environment.

[0115] Further, the application server can also quickly and accurately index to the corresponding pre-device according to the second test identifier, download the target service code corresponding to the second test identifier in the pre-device, and then, the application server calls the SDK toolkit, fills the predefined first function name into the SDK toolkit, combines it with other function names defined in the SDK toolkit to obtain the second function name, so that the SDK toolkit can compile the service code through the second function name to obtain the second intermediate code.

[0116] Optionally, based on the corresponding embodiment above, in another optional embodiment of the test method for the target test stub service provided by the embodiments of the present application, when the target code is executed and a test query message for the target service is received, the test query message is sent to the target test stub service for processing according to the target test stub service address in the target code, including: Figure 4 When the target code is executed and a test query message for the target service is received, the test query message is processed into a test query plaintext according to the target code;

[0117] The test query plaintext is sent to the target test stub service corresponding to the target test stub service address for processing.

[0118] In this embodiment, executing the target code can be understood as the application server can access the target test stub service to perform performance simulation of a certain business service. Therefore, when a test query message for the target service is received, the application server can process the test query message into a test query plaintext according to the message processing method in the target code, and then, can access the target test stub service according to the target test stub service address, and send the processed test query plaintext to the target test stub service through the network communication protocol for identification and processing, and can be automatically routed to the target test stub service through the target test stub service address in the target code, realizing low-cost access to the target test stub service and the target test stub service. Secondly, the test query plaintext that can be recognized and processed by the target test stub service can be obtained through the running target code, realizing the automatic test of the target test stub service, thereby reducing the development cost.

[0119]

[0120] ​Specifically, when receiving a test query message for a target service, the application server may process the test query message into a test query plaintext according to the processing method corresponding to the "message encryption" processing link in the target code being "not encrypted". At the same time, the application server may automatically access the target test stub service through the communication address corresponding to the "message communication" processing link in the target code being the "target test stub service address". Then, the application server may send the processed test query plaintext to the target test stub service for processing through the network communication protocol to achieve the automatic testing of the target test stub service.

[0121] Optionally, based on the corresponding embodiment above, Figure 4 In another optional embodiment of the test method for the target test stub service provided by the embodiments of the present application, the second bytecode includes the target service server interface address; if a response message returned by the target test stub service is received, after the test of the target test stub service is successful, the method further includes:

[0122] Updating the target code to the second intermediate code and executing the second intermediate code;

[0123] When receiving a target service message, sending the target service message to the target service server for processing according to the target service server interface address in the second intermediate code.

[0124] In this embodiment, after the test of the target test stub service is successful, it can be understood that the application server accesses the target service server for the performance stability of a certain service. Therefore, the developer can end the test deployment phase. At this time, the target service server can open the production environment corresponding to this service for the service object through the application server. The application server can update the target code to the second intermediate code and execute the second intermediate code. Then, when receiving the target service message sent by the service object through the terminal device, the application server can access the target service server according to the target service server interface address in the second intermediate code and send the target service message to the target service server for processing through the network communication protocol, without invading the service code in the front-end device, and can accurately and quickly access the target service server for service processing, which can avoid financial risks caused by incorrect operations caused by invading the service code in the front-end device to maintain the stability of the production environment.

[0125] Among them, the target service message is the message data formed by the request or instruction sent by the service object through the target terminal device, which can specifically be manifested as enterprise fund query, income or expenditure query, or payment and collection services, etc., and can also be other manifestations, which are not specifically limited here.

[0126] Specifically, such as Figure 6As shown, after the test of the target test stub service is successful, the application server can stop running the target code. Furthermore, the obtained second intermediate code can be re-input into the interpreter, and the interpreter can reload the second intermediate code, that is, update the target code to the second intermediate code. Then, the application server can run the second intermediate code in the operating system.

[0127] Furthermore, after the second intermediate code runs, it can be understood that the target business server is opened through the production environment corresponding to a certain business service of the application server facing the business object. The application server can stably access the target business server to carry out this business service. Therefore, when the application server receives the target business message, the application server can automatically access the target business server according to the target business server interface address in the second code. Then, the application server can send the processed target business message to the target business server for processing through the network communication protocol.

[0128] For example, assume that the received target business message is "query total funds". Then, the application server can access the target business server "Bank C" through the message communication address in the running second intermediate code, which is "the SDK interface address of the target business server is S2", and can send the target business message "query total funds" to the target business server "Bank C" through the network communication protocol, so that the target business server "Bank C" can decrypt, verify the signature, etc. of the target business message, and thus can obtain the decrypted target business message "query total funds", and then perform corresponding fund query processing.

[0129] Optionally, based on the corresponding embodiments above Figure 4 In another optional embodiment of the test method of the target test stub service provided by the embodiments of the present application, when receiving the target business message, sending the target business message to the target business server for processing according to the target business server interface address in the second intermediate code includes:

[0130] When receiving the target business message, process the target business message into a target business ciphertext according to the encryption algorithm corresponding to the target business server interface in the second intermediate code;

[0131] Send the target business ciphertext to the target business server corresponding to the target business server interface address for processing.

[0132] In this embodiment, executing the second intermediate code can be understood as the application server can access the target business server to process a certain business service. Therefore, when receiving the target business message sent by the business object through the terminal device, the application server can process the target business message into the target business ciphertext according to the message processing method in the second code. Then, it can access the target business server according to the target business service interface address and send the processed target business ciphertext to the target business server through the network communication protocol for decryption or signature verification and other processing first to parse the target business ciphertext into the target business plaintext. Then, it can further identify and process the parsed target business plaintext. Without invading the business code in the front-end device, it can use the second intermediate code compiled by the business code to perform corresponding encryption or signature verification processing on the received target business message to obtain the target business ciphertext, which can ensure the security of the message and thus maintain the stability of the production environment.

[0133] Specifically, when receiving the target business message of the target business, the application server can process the target business message into the target business ciphertext according to the processing method corresponding to the "message encryption" processing link in the second code, which is "encrypt the message according to the SDK encryption algorithm". At the same time, the communication address corresponding to the "message communication" processing link in the second intermediate code of the application server is the "target business server interface address", and it can automatically access the target business server. Then, the application server can send the processed target business ciphertext to the target business server through the network communication protocol for processing.

[0134] The test device of the target test stub service in this application will be described in detail below. Please refer to Figure 7 , Figure 7 FIG. 10 is a schematic diagram of an embodiment of the test device of the target test stub service in the embodiment of this application. The test device 20 of the target test stub service includes:

[0135] A receiving unit 201, configured to receive a test request for the target test stub service;

[0136] An obtaining unit 202, configured to obtain the first intermediate code and the second intermediate code according to the test request, where the first intermediate code carries a priority loading identifier, the first intermediate code includes a first function name and a first bytecode corresponding to the first function name, the first bytecode includes the target test stub service address, and the second intermediate code is compiled from the business code of the target business;

[0137] A processing unit 203, configured to load the first intermediate code and the second intermediate code according to the order of the priority loading identifiers to obtain the target code;

[0138] The processing unit 203 is further configured to execute the target code, and when receiving a test query message of the target service, send the test query message to the target test stub service for processing according to the target test stub service address in the target code;

[0139] The receiving unit 201 is further configured to, if receiving a response message returned by the target test stub service, it indicates that the test of the target test stub service is successful.

[0140] Optionally, based on the above Figure 7 In another embodiment of the test device for the target test stub service provided by the embodiment of the present application, on the basis of the corresponding embodiment, the processing unit 203 may specifically be configured to:

[0141] Load the first intermediate code preferentially according to the sequence of the priority loading identifiers;

[0142] When the second intermediate code is loaded after the first intermediate code is loaded, filter the second intermediate code according to the first function name to obtain the local second intermediate code different from the first function name;

[0143] Load the local second intermediate code to obtain the target code.

[0144] Optionally, based on the above Figure 7 In another embodiment of the test device for the target test stub service provided by the embodiment of the present application, on the basis of the corresponding embodiment, the processing unit 203 may specifically be configured to:

[0145] After the first intermediate code is loaded, load the second intermediate code according to the first function name. If a second function name identical to the first function name is identified in the second intermediate code, ignore the second function name and the second bytecode corresponding to the second function name;

[0146] If a second function name different from the first function name is identified in the second intermediate code, use the second function name and the second bytecode corresponding to the second function name as the local second intermediate code.

[0147] Optionally, based on the above Figure 7 In another embodiment of the test device for the target test stub service provided by the embodiment of the present application, on the basis of the corresponding embodiment, the obtaining unit 202 may specifically be configured to:

[0148] Download the first intermediate code according to the first test identifier;

[0149] Download the service code according to the second test identifier, and compile the service code according to the second function name to obtain the second intermediate code.

[0150] Optionally, based on the above Figure 7Based on the corresponding embodiment, in another embodiment of the test device for the target test stub service provided by the embodiments of the present application, the processing unit 203 may specifically be used for:

[0151] Execute the target code, and when receiving a test query message for the target service, process the test query message into a test query plaintext according to the target code;

[0152] Send the test query plaintext to the target test stub service corresponding to the target test stub service address for processing.

[0153] Optionally, based on the above Figure 7 corresponding embodiment, in another embodiment of the test device for the target test stub service provided by the embodiments of the present application,

[0154] The processing unit 203 is further used to update the target code to a second intermediate code and execute the second intermediate code;

[0155] The processing unit 203 is further used to, when receiving a target service message, send the target service message to the target service server for processing according to the target service server interface address in the second intermediate code

[0156] Optionally, based on the above Figure 7 corresponding embodiment, in another embodiment of the test device for the target test stub service provided by the embodiments of the present application, the processing unit 203 may specifically be used for:

[0157] When receiving a target service message, process the target service message into a target service ciphertext according to the encryption algorithm corresponding to the target service server interface in the second intermediate code;

[0158] Send the target service ciphertext to the target service server corresponding to the target service server interface address for processing.

[0159] On the other hand, the present application provides another schematic diagram of a computer device, as Figure 8 shown, Figure 8It is a schematic structural diagram of a computer device provided by an embodiment of the present application. The computer device 300 may vary greatly due to different configurations or performances, and may include one or more central processing units (CPUs) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 (for example, one or more mass storage devices) for storing application programs 331 or data 332. Among them, the memory 320 and the storage media 330 may be transient storage or persistent storage. The program stored in the storage media 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the computer device 300. Further, the central processing unit 310 may be configured to communicate with the storage media 330 and execute a series of instruction operations in the storage media 330 on the computer device 300.

[0160] The computer device 300 may further include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input / output interfaces 360, and / or one or more operating systems 333, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM and so on.

[0161] The above computer device 300 is also used to execute the steps in the Figure 4 corresponding embodiments.

[0162] On the other hand, the present application provides a computer-readable storage medium. Instructions are stored in the computer-readable storage medium, and when they run on a computer, the computer is caused to execute the steps in the method described in the Figure 4 illustrated embodiment.

[0163] On the other hand, the present application provides a computer program product containing instructions. When it runs on a computer or a processor, the computer or the processor is caused to execute the steps in the method described in the Figure 4 illustrated embodiment.

[0164] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0165] In several embodiments provided by the present application, 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 merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0166] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0167] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0168] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs, and other various media that can store program codes.

Claims

1. A test method for a target test pile service, characterized in that, Including: Receiving a test request for the target test stub service; Obtaining a first intermediate code and a second intermediate code according to the test request, wherein the first intermediate code carries a priority loading identifier, the first intermediate code includes a first function name and a first bytecode corresponding to the first function name, the first bytecode includes the target test stub service address, and the second intermediate code is obtained by compiling the business code of the target service; Loading the first intermediate code preferentially according to the sequence of the priority loading identifiers; When loading the second intermediate code after loading the first intermediate code, performing a filtering operation on the second intermediate code according to the first function name to obtain a partial second intermediate code different from the first function name; Loading the partial second intermediate code to obtain a target code; Executing the target code, and when receiving a test query message of the target service, sending the test query message to the target test stub service for processing according to the target test stub service address in the target code; If a response message returned by the target test stub service is received, the test of the target test stub service is successful.

2. The method according to claim 1, characterized in that The step of, when loading the second intermediate code after loading the first intermediate code, performing a filtering operation on the second intermediate code according to the first function name to obtain a partial second intermediate code different from the first function name includes: After loading the first intermediate code, loading the second intermediate code according to the first function name. If a second function name identical to the first function name is identified in the second intermediate code, ignoring the second function name and the second bytecode corresponding to the second function name; If a second function name different from the first function name is identified in the second intermediate code, taking the second function name and the second bytecode corresponding to the second function name as the partial second intermediate code.

3. The method according to claim 2, wherein The test request carries a first test identifier and a second test identifier; The step of obtaining a first intermediate code and a second intermediate code according to the test request includes: Downloading the first intermediate code according to the first test identifier; Downloading the business code according to the second test identifier and compiling the business code according to the second function name to obtain the second intermediate code.

4. The method according to claim 1, wherein The step of executing the target code, and when receiving a test query message of the target service, sending the test query message to the target test stub service for processing according to the target test stub service address in the target code includes: Executing the target code, and when receiving a test query message of the target service, processing the test query message into a test query plaintext according to the target code; Sending the test query plaintext to the target test stub service corresponding to the target test stub service address for processing.

5. The method according to claim 2, characterized in that, The second bytecode includes a target business server interface address; If a response message returned by the target test stub service is received, after the test of the target test stub service is successful, the method further includes: Updating the target code to the second intermediate code and executing the second intermediate code; When the target service message is received, sending the target service message to a target service server for processing according to the target service server interface address in the second intermediate code.

6. The method according to claim 5, characterized in that, The step of "when the target service message is received, sending the target service message to a target service server for processing according to the target service server interface address in the second intermediate code" includes: When the target service message is received, processing the target service message into a target service ciphertext according to the encryption algorithm corresponding to the target service server interface in the second intermediate code; Sending the target service ciphertext to the target service server corresponding to the target service server interface address for processing.

7. A test device for a target test stub service, characterized in that, including: A receiving unit, configured to receive a test request for the target test stub service; An obtaining unit, configured to obtain a first intermediate code and a second intermediate code according to the test request, where the first intermediate code carries a priority loading identifier, the first intermediate code includes a first function name and a first bytecode corresponding to the first function name, the first bytecode includes the target test stub service address, and the second intermediate code is compiled from the service code of the target service; A processing unit, configured to preferentially load the first intermediate code according to the order of the priority loading identifiers; The processing unit is further configured to, when the second intermediate code is loaded after the first intermediate code is loaded, perform a filtering operation on the second intermediate code according to the first function name, and obtain a partial second intermediate code different from the first function name; The processing unit is further configured to load the partial second intermediate code to obtain a target code; The processing unit is further configured to execute the target code, and when a test query message of the target service is received, send the test query message to the target test stub service for processing according to the target test stub service address in the target code; The receiving unit is further configured to, if a response message returned by the target test stub service is received, the test of the target test stub service is successful.

8. The device according to claim 7, characterized in that, The processing unit is specifically configured to: After the first intermediate code is loaded, load the second intermediate code according to the first function name. If a second function name identical to the first function name is identified in the second intermediate code, ignore the second function name and the second bytecode corresponding to the second function name; If a second function name different from the first function name is identified in the second intermediate code, use the second function name and the second bytecode corresponding to the second function name as the partial second intermediate code.

9. The device according to claim 8, characterized in that, The test request carries a first test identifier and a second test identifier; the obtaining unit is specifically configured to: Download the first intermediate code according to the first test identifier; Download the service code according to the second test identifier, and compile the service code according to the second function name to obtain the second intermediate code.

10. The device according to claim 7, characterized in that, The processing unit is specifically configured to: Execute the target code, and when receiving a test query message of the target service, process the test query message into a test query plaintext according to the target code; Send the test query plaintext to the target test stub service corresponding to the target test stub service address for processing.

11. The device according to claim 8, characterized in that, The second bytecode includes the target service server interface address; the processing unit is further configured to: Update the target code to the second intermediate code, and execute the second intermediate code; When receiving the target service message, send the target service message to the target service server for processing according to the target service server interface address in the second intermediate code.

12. The device according to claim 11, wherein The processing unit is specifically configured to: When receiving the target service message, process the target service message into a target service ciphertext according to the encryption algorithm corresponding to the target service server interface in the second intermediate code; Send the target service ciphertext to the target service server corresponding to the target service server interface address for processing.

13. A computer device, characterized in that, It includes: A memory, a transceiver, a processor, and a bus system; Wherein, the memory is used to store programs; The processor is used to implement the method according to any one of claims 1 to 6 when executing the programs in the memory; The bus system is used to connect the memory and the processor so that the memory and the processor can communicate.

14. A computer-readable storage medium, including instructions, when running on a computer, causes the computer to execute the method according to any one of claims 1 to 6.

15. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Test method and device, electronic device and storage medium

    CN109347700A

  • Code testing method and device

    CN113553250A