Test method and device for online consultation customer service, electronic equipment and storage medium

By using Mock services to simulate the behavior of third-party services in testing, the difficulty in constructing test data caused by strong dependence on third-party services is solved, and the testing efficiency and convenience of data management are improved.

CN119807031APending Publication Date: 2025-04-11MICRO INSURANCE AGENCY LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411753295.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Strong reliance on third-party services (such as enterprise WeChat API) causes difficulties in constructing test data during the testing process, thereby reducing testing efficiency.

Method used

Mock services are used to simulate the behavior of third-party services. By obtaining and analyzing the Mock identifier in the data request, determining the test scenarios and tampering rules, reading test data from the database and tampering with the content of the response packet, so as to realize the autonomous construction and control of the test data.

Benefits of technology

Mock services simulate the behavior of third-party services, reduce dependence on external services, improve testing efficiency, and simplify the construction and maintenance of test data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807031A_ABST
    Figure CN119807031A_ABST
Patent Text Reader

Abstract

The invention relates to an online consultation customer service test method and device, electronic equipment and a storage medium, and is applied to Mock service, the method comprises the following steps: obtaining a data request sent by a platform customer service of a third-party service, the third-party service being an enterprise-level instant messaging platform, the platform customer service being a robot customer service, and the robot customer service being an enterprise-level instant messaging platform; the data request is used for feeding back a consultation result according to consultation of a test user; if it is determined that the data request contains a Mock identifier, a test scene and a tampering rule hit by the data request are determined, and the Mock identifier is used for indicating that the data request is a test request; reading corresponding test data from a database according to the test scene, and tampering content in a response packet according to the tampering rule and the test data, the response packet being sent by the third-party service; and feeding back the tampered response packet to the platform customer service. The test efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a testing method, device, electronic device and storage medium for online customer service consultation. Background Art

[0002] In order to provide users with more professional and considerate manual services, users can actively contact the platform customer service on the user service platform for consultation, complaints and other requests. For example, when a user consults about insurance business on the insurance agency platform, the user service platform will assign work to platform customer service in different positions and roles according to different products, different user levels, different demands (such as pre-sales consultation, after-sales consultation, etc.) and other business scenarios in accordance with preset system rules. The platform will handle and follow up on users' demands online in real time and solve customer problems in a timely manner, thereby avoiding damage to users' rights and interests due to service delays or incorrect processing.

[0003] In the entire processing process, from the time the customer initiates the consultation to the end of the session, you need to use the WeChat Work API to obtain and change the session status, such as Figure 1 As shown in the figure, in order to achieve the distribution management of sessions, strong reliance on third-party services (Enterprise WeChat API) will cause some problems. For example, the Enterprise WeChat API is controlled by an external system, and the testing team cannot directly control the behavior of the API and the returned data, which may make it difficult to construct specific test scenarios and data. The test data needs to be consistent with the data in the Enterprise WeChat API, otherwise it may cause test failures or inconsistent results. Maintaining this consistency is very time-consuming and error-prone.

[0004] Therefore, strong reliance on third-party services can easily make test data construction difficult, leading to low testing efficiency. Summary of the invention

[0005] The present application provides a testing method, device, electronic device and storage medium for online consulting customer service to solve the problem of low testing efficiency.

[0006] This application provides a testing method for online customer service consultation, which is applied to Mock service. The method includes:

[0007] Obtaining a data request sent by a platform customer service of a third-party service, wherein the third-party service is an enterprise-level instant messaging platform, the platform customer service is a robot customer service, and the data request is used to feedback a consultation result based on the consultation of the test user;

[0008] If it is determined that the data request contains a Mock identifier, determining a test scenario and a tampering rule hit by the data request, wherein the Mock identifier is used to indicate that the data request is a test request;

[0009] Reading corresponding test data from a database according to the test scenario, and tampering with content in a response packet according to the tampering rule and the test data, wherein the response packet is sent by the third-party service;

[0010] The tampered response packet is fed back to the platform customer service.

[0011] Optionally, determining the test scenario and tampering rule hit by the data request includes:

[0012] Determine the interface type, color mark and specific parameters in the data request, wherein the specific parameters are used to indicate the association relationship between the platform customer service and the user;

[0013] Searching for a hit test scenario from a scenario library according to the interface type, wherein the scenario library contains an association relationship between each interface type and the test scenario;

[0014] Taking the interface type, the coloring mark and the specific parameter as tampering conditions, searching for a hit tampering rule from a preset rule base, wherein each tampering rule in the rule base includes a tampering condition and corresponding tampering data.

[0015] Optionally, tampering the content in the response packet according to the tampering rule and the test data includes:

[0016] If the test scenario is to read a message, a corresponding message body is constructed according to the message type in the test data, and a message response package corresponding to the test scenario is obtained from the third-party service, wherein the message body is used to describe the message content of the test data;

[0017] The content in the message response packet is tampered with according to the message body and the current call number recorded by the counter, wherein the counter is used to indicate the number of times the current user has called the interface, and different call numbers are used to execute different response packet tampering processes.

[0018] Optionally, tampering the content in the response packet according to the tampering rule and the test data includes:

[0019] If the test scenario is to obtain a session state, obtaining a session response packet corresponding to the test scenario from the third-party service;

[0020] The session state in the session response packet is tampered with according to the tampering rule, so that the tampered session state conforms to the current session scenario.

[0021] Optionally, after tampering the content in the response packet according to the tampering rule and the test data, the method further includes:

[0022] The test data in the database is synchronously updated according to the data in the response packet after the tampering.

[0023] Optionally, determining that the data request includes a Mock identifier includes:

[0024] If it is determined that the data request includes a coloring mark, and the interface type in the data request belongs to a preset interface type, it is determined that the data request includes a Mock identifier, wherein the coloring mark is used to indicate that the data request is a test request rather than a real request.

[0025] This application provides a testing method for online consulting customer service, which is applied to the platform customer service of third-party services, and the method includes:

[0026] Obtaining an event package sent by an automated device, wherein the automated device is a preset test framework, and the event package is used to simulate data generated when a real user interacts with a platform customer service;

[0027] Analyze the event type in the event package to determine the interface type corresponding to the event package;

[0028] If it is determined that the interface type belongs to the preset interface type, a data request is sent to the Mock service, so that the Mock service determines the test scenario and tampering rules hit by the data request when it is determined that the data request contains a Mock identifier; reads the corresponding test data from the database according to the test scenario; tampers the content in the response package according to the tampering rules and the test data; updates the test data in the database according to the tampered data, wherein the data request is used to feedback the consultation result according to the user's consultation, the Mock identifier is used to indicate that the data request is a test request, and the response package is sent by the third-party service;

[0029] Receive the tampered response packet sent by the Mock service.

[0030] The present application provides a testing device for online customer service consultation, which is applied to Mock service, and the device includes:

[0031] An acquisition module, used to acquire a data request sent by a platform customer service of a third-party service, wherein the third-party service is an enterprise-level instant messaging platform, the platform customer service is a robot customer service, and the data request is used to feedback a consultation result based on the consultation of the test user;

[0032] A determination module, configured to determine a test scenario and a tampering rule hit by the data request if it is determined that the data request contains a Mock identifier, wherein the Mock identifier is used to indicate that the data request is a test request;

[0033] A tampering module, used to read corresponding test data from a database according to the test scenario, and tamper the content in a response packet according to the tampering rule and the test data, wherein the response packet is sent by the third-party service;

[0034] The feedback module is used to feed back the tampered response package to the platform customer service.

[0035] The present application provides a testing device for online customer service consultation, which is applied to the platform customer service of third-party services, and the device includes:

[0036] An acquisition module, used to acquire an event package sent by an automation device, wherein the automation device is a preset test framework, and the event package is used to simulate data generated when a real user interacts with a platform customer service;

[0037] A determination module, used to analyze the event type in the event package and determine the interface type corresponding to the event package;

[0038] A sending module, used for sending a data request to a Mock service if it is determined that the interface type belongs to a preset interface type, so that the Mock service determines the test scenario and tampering rule hit by the data request when it is determined that the data request contains a Mock identifier; reads the corresponding test data from a database according to the test scenario; tampers the content in a response packet according to the tampering rule and the test data; and updates the test data in the database according to the tampered data, wherein the data request is used to provide a consultation result based on the user's consultation feedback, the Mock identifier is used to indicate that the data request is a test request, and the response packet is sent by the third-party service;

[0039] The receiving module is used to receive the tampered response packet sent by the Mock service.

[0040] The present application provides an electronic device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus.

[0041] The present application also provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the online consulting customer service testing method described in any one of the above items of the present application.

[0042] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: if the Mock service determines that the data request is a test request based on the Mock identifier, the data request is analyzed to obtain the test scenario and tampering rules. The test scenario is used to obtain the corresponding test data in the database, and then the data in the response package is tampered with in combination with the test scenario and tampering rules, so that the Mock service simulates the behavior of the real third-party service in order to handle consulting business, and the tampered results are fed back to the platform customer service. This application simulates the behavior of the third-party service based on the Mock service, avoiding the problems caused by strong dependence on the third-party service, thereby improving the testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0046] Figure 1 A signaling diagram for a user to access a consulting platform in the prior art;

[0047] Figure 2 It is a schematic diagram of session state flow in the prior art;

[0048] Figure 3 A timing diagram of each API call in the prior art;

[0049] Figure 4 A schematic diagram of a test system for online customer service provided in an embodiment of the present application;

[0050] Figure 5 A flow chart of a testing method for online customer service consultation provided in an embodiment of the present application;

[0051] Figure 6 A test signaling diagram of the online customer service provided in the embodiment of the present application;

[0052] Figure 7 A schematic diagram of the process of online customer service consultation provided in the embodiment of the present application;

[0053] Figure 8 A schematic diagram of the structure of a test device for online customer service consultation provided in an embodiment of the present application;

[0054] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0056] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0057] The following are some explanations of the terms that appear in this application:

[0058] Manual customer service: In the customer service center, real customer service personnel (not automated systems or robots) handle customer inquiries, complaints, technical support and other service requests. Manual customer service is not used in mock testing scenarios, but in real user consultation scenarios, such as Figure 1 In the scenario where a real user initiates a consultation.

[0059] Platform customer service: used to meet the customer service needs of enterprises and help them provide good customer service. Enterprises can access platform customer service in various scenarios inside and outside third-party services. Users can initiate inquiries and enterprises can respond. Platform customer service is a robot that can automatically respond to users. For example, if the third-party service is WeChat, then the platform customer service is WeChat customer service.

[0060] In the related technology, if a third-party platform is used to implement platform customer service to handle user consultation business, it usually takes Figure 1The third-party service is an enterprise-level instant messaging platform, such as the WeChat platform. The platform customer service is a robot customer service, such as the WeChat customer service. There can be multiple platform customer service. The following is an explanation using the WeChat platform as an example. Figure 1 Describes three situations of user-customer service interaction: 1. After the user comes online, the enterprise WeChat backend will send the event callback data packet to the WeChat customer service backend (wesure-scrm-wxkf-core). After receiving the request, the WeChat customer service actively reads the specific message content through the enterprise WeChat message interface. At this time, the session status changes to "new access, unprocessed". 2. The user sends a message, calls the dispatch layer, and assigns a manual customer service according to the preset dispatch rules. At this time, the session status changes to "received by manual". 3. The user times out without replying or the manual customer service actively ends the session, and the session is closed.

[0061] From the time a WeChat user initiates a consultation to the end of the conversation, the conversation may go through the following processes: Figure 2 The state flow shown. Enterprises or third parties can use APIs to obtain and change session states to achieve session allocation management. When changing the session state, you can only change from the current state to other specific states.

[0062] Figure 3 From the sequence diagram of each API call, we can see that in the entire WeChat customer service session life cycle, the core APIs involved in WeChat for Business are: obtaining basic customer information, sending welcome messages and other event response messages, reading messages, obtaining session status, and changing session status. The strong reliance on third-party services makes it difficult to construct test data, resulting in low test efficiency.

[0063] In order to solve the problems mentioned in the background technology, according to one aspect of an embodiment of the present application, an embodiment of a test for online consulting customer service is provided.

[0064] Optionally, in the embodiment of the present application, the above-mentioned online customer service testing method can be applied to Figure 4 In the hardware environment shown in FIG. 1 , the platform customer service 401 and the mock service 403 can be two independent hardware servers, or they can be independently operated on the same hardware server. Figure 1As shown, the platform customer service 401 is connected to the Mock service 403 through the network. The platform customer service is used to control the interface of the Mock service through matching rules. After the Mock 403 intercepts the interface request, it tampers with the content of the response packet according to the test data, and then feeds back the tampered response packet to the platform customer service. A database 405 can be set independently of the Mock service 403 to store test data for the Mock service. The above network includes but is not limited to: a wide area network, a metropolitan area network or a local area network.

[0065] A testing method for online consulting customer service in an embodiment of the present application can be executed by platform customer service 401 or by Mock service 403.

[0066] The following will be combined with a specific implementation method to describe in detail a test method for online consulting customer service provided in an embodiment of the present application, taking the application of Mock service as an example. Figure 5 As shown, the specific steps are as follows:

[0067] Step 501: obtaining a data request sent by a platform customer service of a third-party service, wherein the third-party service is an enterprise-level instant messaging platform, the platform customer service is a robot customer service, and the data request is used to provide consultation results based on the consultation feedback of the test user;

[0068] Step 502: If it is determined that the data request contains a Mock identifier, then determine the test scenario and tampering rule that the data request hits, wherein the Mock identifier is used to indicate that the data request is a test request;

[0069] Step 503: Read corresponding test data from the database according to the test scenario, and tamper with the content in the response packet according to the tampering rule and the test data, wherein the response packet is sent by the third-party service;

[0070] Step 504: Feedback the tampered response packet to the platform customer service.

[0071] This application adds an intermediate proxy layer Mock service between the platform customer service and the third-party service. The platform customer service sends the data request to the Mock service instead of the third-party service. The data of the response package is tampered with through the Mock service, which reduces the dependence on external services, focuses on local testing, and improves testing efficiency.

[0072] This application is applicable to both test requests and real requests. After the platform customer service obtains the data request, if it detects that the interface type in the data request does not belong to the preset interface type, indicating that it is a real request, the platform customer service directly sends the data request to the third-party service, and the third-party service feeds back a response package to the platform customer service; if the interface type detected by the platform customer service belongs to the preset interface type, indicating that it is a test request, the platform customer service sends the data request to the Mock service, and the Mock service tamper with the response package content of the third-party service, and then feeds back the tampered response package to the platform customer service.

[0073] The present application provides an automation device, which is essentially a test framework. The automation device can configure test data in advance and store the test data persistently in a database, such as MySQL, and can build an event package based on the test data. The event package can simulate the data generated when a real user interacts with the platform customer service, such as message type, user ID, customer service status, etc.

[0074] The platform customer service obtains the event package from the automation device and analyzes the event type in the event package to determine the interface type corresponding to the event type, where each event type corresponds to an interface type, and the interface type refers to the category of the interface through which the platform customer service interacts with third-party services.

[0075] If the platform customer service determines that the interface type belongs to the preset interface type, indicating that the event package is a test request rather than a real user call, then it is necessary to send a data request to the Mock service, so that the Mock service simulates the behavior of the third-party service and feeds back the user's consultation results to the platform customer service.

[0076] The event types include, but are not limited to, reading a message, sending a welcome message, obtaining a session status, or ending a session.

[0077] In the embodiment of the present application, the interfaces corresponding to the preset interface types are as follows:

[0078]

[0079] Correspondingly, the above six interface types correspond to six test scenarios, namely reading messages, sending welcome messages, obtaining basic customer information, changing session status, obtaining session status and upgrading services.

[0080] This application uses a test request. Compared with a real request, the Mock service intercepts the data request that should be sent to the third-party service, and then verifies whether the data request contains a Mock identifier, which is used to indicate that the current data request is a test request. If the Mock identifier is not included, it indicates that the platform customer service and the Mock service have inconsistent detection results on whether the current request is a test request or a real request, and an error message is fed back to the platform customer service; if the Mock identifier is included, it is confirmed to be a test request, and then the Mock service analyzes the data request to determine the test scenario and tampering rules hit by the data request.

[0081] The database stores test data, which are divided according to test scenarios or set with test scenario labels. The Mock service can read the corresponding test data from the database according to the test scenario, and then tamper with the content in the response package according to the tampering rules and test data. Mock feeds back the tampered response package to the platform customer service. The platform customer service actively reads the specific message content or updates the receptionist status (such as online, offline, etc.) through the message reading interface based on the response package.

[0082] Among them, the response package is sent by the third-party service to the Mock service. After the Mock service obtains the data request sent by the platform customer service, it forwards the data request to the third-party service. The third-party service returns different response packages to the Mock service according to its own processing logic and different event types and request types.

[0083] Optionally, the test data stored in the database includes but is not limited to: user incoming scenario code, user incoming scenario code parameters, whether data is deleted, test scenario token, welcome message content, message sending subject (external user, system or receptionist), online and offline status of the switchboard staff (reception in progress or stopped), external user id, session status change type, session status change old receptionist account, session status change updated receptionist account, etc.

[0084] In this application, if the Mock service determines that the data request is a test request based on the Mock identifier, the data request is analyzed to obtain the test scenario and tampering rules. The test scenario is used to obtain the corresponding test data in the database, and then the data in the response package is tampered with in combination with the test scenario and tampering rules, so that the Mock service can simulate the behavior of the real third-party service in order to handle consulting business, and the tampered results are fed back to the platform customer service. This application simulates the behavior of third-party services based on the Mock service to avoid the problems caused by strong dependence on third-party services, thereby improving testing efficiency.

[0085] As an optional implementation method, the platform customer service detects that the data request is a test request. If the platform customer service fails, the detection result may be inaccurate because it is necessary to verify again that the data request contains a Mock identifier before performing the Mock test. The verification process includes: if it is determined that the data request contains a color mark and the interface type in the data request belongs to a preset interface type, then it is determined that the data request contains a Mock identifier, wherein the color mark is used to indicate that the data request is a test request rather than a real request.

[0086] The embodiment of the present application adds a coloring mark to the simulated event package, and the coloring mark is used to indicate that the data request is a test request rather than a real request. For example, the coloring mark includes a token and a user ID. For the business process implemented by the automation device, the token starts with a prefix of coding, and the user ID starts with wcoding.

[0087] In addition, the Mock service needs to verify again whether the interface type belongs to the preset interface type. If it is determined that the data request contains the color mark and the interface type belongs to the preset interface type, it is determined that the data request contains the Mock identifier.

[0088] This application will only execute the test processing of the Mock service when the data request is verified as a test request by both the platform customer service and the Mock service, avoiding Mock testing for real user events and improving the accuracy of Mock testing.

[0089] As an optional implementation, in step 502, determining the test scenario and tampering rule hit by the data request includes the following steps:

[0090] Step 5021: Determine the interface type, color mark and specific parameters in the data request, wherein the specific parameters are used to indicate the association relationship between the platform customer service and the user;

[0091] Step 5021: searching for a matching test scenario from a scenario library according to the interface type, wherein the scenario library contains an association relationship between each interface type and the test scenario;

[0092] Step 5021: Taking the interface type, coloring mark and specific parameters as tampering conditions, searching for a hit tampering rule from a preset rule base, wherein each tampering rule in the rule base includes a tampering condition and corresponding tampering data.

[0093] The Mock service analyzes the data request and obtains three types of data: interface type, color mark, and specific parameters. Specific parameters are used to indicate the relationship between the platform customer service and the user, such as the user adding corporate WeChat, the user and the platform customer service are bound, the platform customer service receptionist changes the service capacity or transfers the session, etc.

[0094] The scenario library contains the association between each interface type and the test scenario. For example, / cgi-bin / kf / sync_msg corresponds to the scenario of reading messages, and / cgi-bin / kf / send_msg_on_event corresponds to the scenario of sending a welcome message. The Mock service searches the scenario library for the matching test scenario based on the analyzed interface type. The test scenario is used to read test data from the database later.

[0095] The rule base includes multiple tampering rules. Each tampering rule is a mapping relationship between tampering conditions and tampering data. Tampering conditions include interface types, coloring marks, and specific parameters. The Mock service searches for matching tampering rules in the rule base based on the tampering conditions obtained by analyzing the data request. Examples of tampering rules in the rule base are as follows:

[0096] genRet=genSyncMsgRespData(params)

[0097] elif method_name==" / cgi-bin / kf / send_msg_on_event"and user_request.get("code","").startswith("welcome_code_monkey_"):##Send welcome message.

[0098] It can be seen that if the interface type is cgi-bin / kf / send_msg_on_event and carries the color tag "code", then a welcome message is sent.

[0099] This application uses specific parameters and considers the relationship between the platform's customer service and users to automatically dispatch customer service so that the actual reception staff meets expectations.

[0100] As an optional implementation, in step 503, tampering the content in the response packet according to the tampering rule and the test data includes multiple embodiments, which are described below by taking reading a message and obtaining a session state as an example.

[0101] In one embodiment, if the test scenario is to read a message, a corresponding message body is constructed according to the message type in the test data, and a message response package corresponding to the test scenario is obtained from a third-party service, wherein the message body is used to describe the message content of the test data; the content in the message response package is tampered with according to the message body and the current number of calls recorded by the counter, wherein the counter is used to indicate the number of times the current user has called the interface, and different numbers of calls are used to execute different response package tampering processes.

[0102] If the Mock service determines that the test scenario is to read messages, it reads the test data for this scenario from the database. The test data includes the message type, external user ID, and message ID, and then constructs the corresponding message body according to the message type. Message types include text messages, image messages, or event messages, and different message types correspond to different message bodies. The message body is part of the response package and usually contains specific business data or content, such as text content, image links, event information, etc.

[0103] The Mock service also forwards the data request to the third-party service. The third-party service generates a message response package corresponding to the test scenario of reading the message according to its own processing logic, and feeds the message response package back to the Mock service. The Mock service puts the above-generated message body into the message response package.

[0104] The embodiment of the present application is provided with a counter, which is used to count the number of times the current user has called the interface. Different call times are used to execute different response packet tampering processes. For example, the first time the user calls the interface, a response packet of a welcome message is generated; the second time the user calls the interface, a response packet of a thank you message is generated; the third time the user calls the interface, a response packet of an inquiry message is generated. After each response packet is generated, the count value of the counter is incremented, thereby determining the next response packet tampering process. The following is an example of the process of tampering with the response packet.

[0105] 1. First call: Message type: Text message

[0106] Read the counter value of user A and find it is 0.

[0107] Generate a response packet with a welcome message: Hello, welcome to our customer service system! How can I help you? .

[0108] Update the counter and add 1 to the counter value of user A, making it 1.

[0109] 2. Second call:

[0110] Message type: Picture message

[0111] Read the counter value of user A and find it is 1.

[0112] Generate a response package with a thank you message: Thank you for your patience, we will resolve the issue for you as soon as possible.

[0113] Update the counter and add 1 to the counter value of user A, changing it to 2.

[0114] 3. The third call:

[0115] Message type: event message

[0116] Read the counter value of user A and find it is 2.

[0117] Generate a response packet to the inquiry message: Is there anything else I can help you with? If you have no further questions, we can end this conversation.

[0118] Update the counter and add 1 to the counter value of user A, which becomes 3.

[0119] In this application, by constructing different message bodies, it is possible to ensure that the data part in the response package is accurate and conforms to the business logic; by constructing different types of message bodies, multiple rounds of conversations between the user and the system can be simulated to ensure that the test covers various actual scenarios.

[0120] By automatically incrementing the counter value, it is determined whether it is the first call, thereby controlling the execution of different response package tampering processes. Through different response packages, multiple rounds of conversations between users and the customer service system can be simulated to ensure that the test covers various actual situations; the counter ensures that the response package of each call is coherent and there will be no inconsistencies due to multiple calls. This method of dynamically generating response content can simulate multiple test scenarios to ensure the comprehensiveness and accuracy of the test.

[0121] In another embodiment, if the test scenario is to obtain the session state, a session response package corresponding to the test scenario is obtained from a third-party service; the session state in the session response package is tampered with according to the tampering rule so that the tampered session state conforms to the current session scenario.

[0122] If the test scenario is to obtain the session status, the Mock service reads the test data for the scenario from the database. The test data includes the session status and the reception customer service account. Then, the session response package corresponding to the test scenario is obtained from the third-party service. The session status and the reception customer service account are modified according to the tampering rules, and the processed data is returned to the platform customer service as a response package.

[0123] As an optional implementation method, after tampering with the content in the response package, the Mock server also needs to synchronously update the test data in the database according to the tampered data. This method can ensure that the test data requested from the database each time is the latest, ensuring the real-time and consistency of the test data.

[0124] For example, with regard to changing the session state, after a series of business processes, the session state changes from the initial "initialization state" to "in session", and the session state of "in session" must also be synchronously updated to the database to ensure data consistency and facilitate subsequent processes to obtain the latest session state when using the session state in the database.

[0125] Based on the same technical concept, this application provides a test signaling diagram for online customer service consultation, taking the third-party service as WeChat for Enterprise as an example. Figure 6 As shown, the following steps are included:

[0126] The automation device simulates the construction of an event package and sends it to the platform customer service. After the platform customer service determines that the interface type hits the preset interface type, it configures the data request of the interface type to the intermediate proxy layer Mock service (Monkey). If the Mock service detects that the data request contains a Mock identifier, it forwards the data request to the third-party service. The third-party service feeds back a response package to the Mock service based on its own logic. The Mock service determines the tampering rules based on the data request (interface type, coloring mark, and specific parameters), and then reads the test data corresponding to the test scenario from the database. Combined with the tampering rules and the test data tampering response package, the tampered response package is fed back to the platform customer service, and the test data in the database is synchronously updated.

[0127] This application supports personalized interception of data requests and tampering of response packages of external services. The data request is passed through a preset interception mechanism, and the intermediate service (monkey) proxy requests the external service, and tampers with the response package according to preset conditions. The tampered response content is linked with the user, third-party service, and platform customer service backend to ensure the consistency and synchronization of information on multiple platforms, with high flexibility and repeatability.

[0128] Based on the same technical concept, this application provides a test signaling diagram for online customer service consultation, including the following steps:

[0129] Step 1: Construct test data through automation and store the test data persistently in the MySQL database.

[0130] Step 2: The automation device sends the event package to the platform customer service.

[0131] Step 3: The platform customer service extracts the event type in the event package and determines the interface type corresponding to the event type.

[0132] Step 4: The platform customer service determines whether the interface type belongs to the preset interface type. If not, execute step 5; if yes, execute step 6.

[0133] Step 5: The platform customer service sends the data request to the third-party service, and the third-party service processes the data and then feeds it back to the platform customer service.

[0134] Step 6: The platform customer service sends the data request to the Mock service.

[0135] Step 7: The Mock service analyzes the data request and obtains the interface type, coloring mark, and specific parameters.

[0136] Step 8: If the interface type is a preset interface type and carries a color mark, it is determined that the event packet is a test request.

[0137] Step 9: Determine the test scenario according to the interface type, and read the test data under the test scenario in the database.

[0138] Step 10: Determine the interface type, dye tag, and tampering rules for specific parameter hits.

[0139] Step 11: The Mock service forwards the data request to the third-party service. The third-party service processes the request according to its own logic and then feeds back the response package to the Mock service.

[0140] Step 12: The Mock service tampered the response packet according to the tampering rules and test data.

[0141] Step 13: The Mock service synchronously updates the modified data in the response packet to the database.

[0142] Among them, steps 7 to 10 and 11 are parallel steps and can be executed simultaneously.

[0143] This application includes two platforms: the enterprise side and the third-party service side. The enterprise side is such as an insurance agency, and the third-party service side is such as WeChat for Enterprise. This application takes WeChat for Enterprise as an example to explain the process in this application. Figure 7 From the test flow diagram of the online consulting customer service provided for this application, it can be seen that the automation device simulates the construction of an event package and sends it to WeChat customer service. After WeChat customer service determines that the interface type hits the preset interface type, it configures the data request of the interface type to the intermediate proxy layer Mock service (Monkey). If Monkey detects that the data request contains a Mock identifier, it forwards the data request to Enterprise WeChat. Enterprise WeChat feeds back a response package to Monkey based on its own logic. Monkey determines the tampering rules based on the data request (interface type, dyeing mark and specific parameters), and then reads the test data corresponding to the test scenario from the database. Combined with the tampering rules and the test data tampering response package, the tampered response package is fed back to WeChat customer service.

[0144] The beneficial effects achieved by this application include:

[0145] (1) Supports pre-persistence of test data, which is divided into test data preparation, test data persistence, and data processing. According to test requirements, test data can be flexibly and automatically generated, data cleaned, and stored in a relational database (MySQL). Data can be flexibly and accurately read on the response end for response processing.

[0146] (2) The universal platform customer service dispatch test device allows testers to focus more on the design of specific business test scenarios. The test scenario data can be flexibly constructed through keyword input, achieving comprehensive coverage of dispatch strategy test scenarios under multiple business scenarios of platform customer service. In addition, the test data is stored in the database in advance and can be reused many times, which can effectively reduce the cost of test data construction and improve test efficiency without having to rebuild the test data each time.

[0147] (3) Effectively reduce dependence on third-party services. Customized development of Mock service processes can be combined with actual business characteristics, and request and response packages can be flexibly designed to meet actual business testing requirements.

[0148] This application also provides a test device for online customer service consultation, such as Figure 8 As shown, it is applied to the Mock service, and the device includes:

[0149] The acquisition module 801 is used to acquire a data request sent by a platform customer service of a third-party service, wherein the third-party service is an enterprise-level instant messaging platform, the platform customer service is a robot customer service, and the data request is used to feedback a consultation result based on the consultation of the test user;

[0150] A determination module 802 is used to determine the test scenario and tampering rule hit by the data request if it is determined that the data request contains a Mock identifier, wherein the Mock identifier is used to indicate that the data request is a test request;

[0151] The tampering module 803 is used to read the corresponding test data from the database according to the test scenario, and tamper the content in the response packet according to the tampering rule and the test data, wherein the response packet is sent by the third-party service;

[0152] Feedback module 804 is used to feed back the tampered response package to the platform customer service.

[0153] Optionally, the determination module 802 is used to:

[0154] Determine the interface type, color mark and specific parameters in the data request, wherein the specific parameters are used to indicate the association relationship between the platform customer service and the user;

[0155] Searching for a matching test scenario from a scenario library according to the interface type, wherein the scenario library contains an association relationship between each interface type and the test scenario;

[0156] Taking the interface type, the coloring mark and the specific parameters as the tampering conditions, the tampering rules that are hit are searched from the preset rule base, wherein each tampering rule in the rule base includes the tampering condition and the corresponding tampering data.

[0157] Optionally, the tampering module 803 is used to:

[0158] If the test scenario is to read messages, construct the corresponding message body according to the message type in the test data, and obtain the message response package corresponding to the test scenario from the third-party service, where the message body is used to describe the message content of the test data;

[0159] The content in the message response package is tampered with according to the message body and the current call number recorded by the counter, where the counter is used to indicate the number of times the current user has called the interface, and different call numbers are used to execute different response package tampering processes.

[0160] Optionally, the tampering module 803 is used to:

[0161] If the test scenario is to obtain the session status, obtain the session response package corresponding to the test scenario from the third-party service;

[0162] The session state in the session response packet is tampered with according to the tampering rule so that the tampered session state conforms to the current session scenario.

[0163] Optionally, the device is also used for:

[0164] The test data in the database is synchronously updated according to the data in the response package after tampering.

[0165] Optionally, the determination module 802 is used to:

[0166] If it is determined that the data request includes a coloring mark, and the interface type in the data request belongs to a preset interface type, then it is determined that the data request includes a Mock identifier, wherein the coloring mark is used to indicate that the data request is a test request rather than a real request.

[0167] The present application also provides a testing device for online customer service consultation, which is applied to the platform customer service of third-party services, and the device includes:

[0168] An acquisition module, used to acquire an event package sent by an automated device, wherein the automated device is a preset test framework, and the event package is used to simulate data generated when a real user interacts with a platform customer service;

[0169] A determination module is used to analyze the event type in the event package and determine the interface type corresponding to the event package;

[0170] A sending module is used to send a data request to a Mock service if it is determined that the interface type belongs to a preset interface type, so that the Mock service can determine the test scenario and tampering rules hit by the data request when it is determined that the data request contains a Mock identifier; read the corresponding test data from the database according to the test scenario; tamper the content in the response package according to the tampering rules and test data; update the test data in the database according to the tampered data, wherein the data request is used to feedback the consultation result according to the user's consultation, the Mock identifier is used to indicate that the data request is a test request, and the response package is sent by a third-party service;

[0171] The receiving module is used to receive the tampered response packet sent by the Mock service.

[0172] like Fig. 9 As shown, an embodiment of the present application provides an electronic device, including a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0173] The memory 903 is used to store computer programs.

[0174] In one embodiment of the present application, the processor 901 is used to implement the online consulting customer service testing method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 903.

[0175] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the online consulting customer service testing method provided in any of the aforementioned method embodiments are implemented.

[0176] The device embodiments described above are merely illustrative, wherein 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0177] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0178] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0179] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A testing method for online customer service, characterized in that: Applied to the Mock service, the method includes: Obtaining a data request sent by a platform customer service of a third-party service, wherein the third-party service is an enterprise-level instant messaging platform, the platform customer service is a robot customer service, and the data request is used to feedback a consultation result based on the consultation of the test user; If it is determined that the data request contains a Mock identifier, determining a test scenario and a tampering rule hit by the data request, wherein the Mock identifier is used to indicate that the data request is a test request; Reading corresponding test data from a database according to the test scenario, and tampering with content in a response packet according to the tampering rule and the test data, wherein the response packet is sent by the third-party service; The tampered response packet is fed back to the platform customer service.

2. The method according to claim 1, characterized in that The test scenarios and tampering rules for determining the data request hits include: Determine the interface type, color mark and specific parameters in the data request, wherein the specific parameters are used to indicate the association relationship between the platform customer service and the user; Searching for a hit test scenario from a scenario library according to the interface type, wherein the scenario library contains an association relationship between each interface type and the test scenario; Taking the interface type, the coloring mark and the specific parameter as tampering conditions, searching for a hit tampering rule from a preset rule base, wherein each tampering rule in the rule base includes a tampering condition and corresponding tampering data.

3. The method according to claim 1, characterized in that: The content of the tampering response packet according to the tampering rule and the test data includes: If the test scenario is to read a message, a corresponding message body is constructed according to the message type in the test data, and a message response package corresponding to the test scenario is obtained from the third-party service, wherein the message body is used to describe the message content of the test data; The content in the message response packet is tampered with according to the message body and the current call number recorded by the counter, wherein the counter is used to indicate the number of times the current user has called the interface, and different call numbers are used to execute different response packet tampering processes.

4. The method according to claim 1, characterized in that: The content of the tampering response packet according to the tampering rule and the test data includes: If the test scenario is to obtain a session state, obtaining a session response packet corresponding to the test scenario from the third-party service; The session state in the session response packet is tampered with according to the tampering rule, so that the tampered session state conforms to the current session scenario.

5. The method according to claim 1, characterized in that After tampering the content in the response packet according to the tampering rule and the test data, the method further includes: The test data in the database is synchronously updated according to the data in the response packet after the tampering.

6. The method according to claim 1, characterized in that Determining that the data request contains a Mock identifier includes: If it is determined that the data request includes a coloring mark, and the interface type in the data request belongs to a preset interface type, it is determined that the data request includes a Mock identifier, wherein the coloring mark is used to indicate that the data request is a test request rather than a real request.

7. A testing method for online customer service consultation, characterized in that: The platform customer service applied to third-party services includes: Obtaining an event package sent by an automated device, wherein the automated device is a preset test framework, and the event package is used to simulate data generated when a real user interacts with a platform customer service; Analyze the event type in the event package to determine the interface type corresponding to the event package; If it is determined that the interface type belongs to the preset interface type, a data request is sent to the Mock service, so that the Mock service determines the test scenario and tampering rules hit by the data request when it is determined that the data request contains a Mock identifier; reads the corresponding test data from the database according to the test scenario; tampers the content in the response package according to the tampering rules and the test data; updates the test data in the database according to the tampered data, wherein the data request is used to feedback the consultation result according to the user's consultation, the Mock identifier is used to indicate that the data request is a test request, and the response package is sent by the third-party service; Receive the tampered response packet sent by the Mock service.

8. A testing device for online customer service consultation, characterized in that: Applied to the Mock service, the device includes: An acquisition module, used to acquire a data request sent by a platform customer service of a third-party service, wherein the third-party service is an enterprise-level instant messaging platform, the platform customer service is a robot customer service, and the data request is used to feedback a consultation result based on the consultation of the test user; A determination module, configured to determine a test scenario and a tampering rule hit by the data request if it is determined that the data request contains a Mock identifier, wherein the Mock identifier is used to indicate that the data request is a test request; a tampering module, configured to read corresponding test data from a database according to the test scenario, and tamper with the content in a response packet according to the tampering rule and the test data, wherein the response packet is sent by the third-party service; The feedback module is used to feed back the tampered response package to the platform customer service.

9. A testing device for online customer service consultation, characterized in that: A platform customer service applied to third-party services, the device comprising: An acquisition module, used to acquire an event package sent by an automation device, wherein the automation device is a preset test framework, and the event package is used to simulate data generated when a real user interacts with a platform customer service; A determination module, used to analyze the event type in the event package and determine the interface type corresponding to the event package; A sending module, used for sending a data request to a Mock service if it is determined that the interface type belongs to a preset interface type, so that the Mock service determines the test scenario and tampering rule hit by the data request when it is determined that the data request contains a Mock identifier; reads the corresponding test data from a database according to the test scenario; tampers the content in a response packet according to the tampering rule and the test data; and updates the test data in the database according to the tampered data, wherein the data request is used to provide a consultation result based on the user's consultation feedback, the Mock identifier is used to indicate that the data request is a test request, and the response packet is sent by the third-party service; The receiving module is used to receive the tampered response packet sent by the Mock service.

10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method described in any one of claims 1 to 6 or 7 when executing a program stored in a memory.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 6 or 7 is implemented.