A data processing method, system, device, apparatus and storage medium

By annotating stub points in the business execution code, contextual and target data can be obtained and processed, solving the problem of recording and querying business data for customer service robots and enabling effective data association, recording, and querying.

CN116127002BActive Publication Date: 2026-05-15MASHANG CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MASHANG CONSUMER FINANCE CO LTD
Filing Date
2022-08-12
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively record and correlate contextual data and target data related to the execution results of customer service robots, leading to isolated data that is difficult to query.

Method used

By annotating stub points in the business execution code, context data and target data are obtained, and the data is processed before and after the execution code to achieve the association of records.

Benefits of technology

It enables effective recording and querying of business-related data, avoiding the data silos problem in existing technologies and improving the convenience of data association.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127002B_ABST
    Figure CN116127002B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method, system, device and storage medium, and relates to recording of target data related to context data of a service and execution result of the service. The method comprises: obtaining a stake point annotation marked by a service execution code corresponding to a to-be-executed service; the stake point annotation is provided with information of a service rule and an execution result processing rule in advance; before the service execution code is executed, specified data of an associated service of the to-be-executed service is obtained as context data of the to-be-executed service according to the information of the service rule; after the service execution code is executed, data matched with the execution result processing rule is obtained from an execution result of executing the service execution code as target data according to the execution result processing rule; and the context data and the target data are recorded in association.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data mining technology, and in particular to a data processing method, system, apparatus, device, and computer-readable storage medium. Background Technology

[0002] Customer service robots, or intelligent customer service robots, are devices that engage in dialogue with users. For intelligent customer service robots, this dialogue refers to guiding users to ask questions and providing final solutions based on a pre-defined conversational flow.

[0003] Conversations between customer service robots and users can be categorized into single-turn and multi-turn dialogues. Regardless of the type, in each turn of the conversation, the customer service robot may need to perform a dialogue-related task. For example, if a user needs the robot to retrieve loan contract details, the robot will perform the task of "retrieving loan contract details based on the contract number provided by the user and providing feedback."

[0004] Currently, in order to optimize business execution methods or analyze the causes of business anomalies, it is necessary to analyze and mine the data related to the business performed by customer service robots.

[0005] How to record data related to the aforementioned business is a problem that needs to be solved by existing technologies. Summary of the Invention

[0006] This application provides a data processing method for recording target data related to the context data of a business and the execution results obtained from executing the business.

[0007] This application also provides a data processing system, apparatus, device, and computer-readable storage medium.

[0008] The embodiments of this application adopt the following technical solutions:

[0009] A data processing method, comprising:

[0010] Obtain the stub annotations marked on the business execution code of the business to be executed; the stub annotations are pre-set with: business rule information, and execution result processing rules;

[0011] Before the business execution code is executed, specified data of the associated business of the business to be executed is obtained according to the information of the business rules, and used as the context data of the business to be executed;

[0012] After the business execution code is executed, the execution result obtained from executing the business execution code is processed according to the execution result processing rules to obtain target data related to the execution result;

[0013] The context data and target data are associated and recorded.

[0014] A data processing system, the system comprising: a code pre-processing module, a business code post-processing module, and a data persistence module, wherein:

[0015] The pre-processing module for the execution code is used to obtain information about business rules from the stub annotations marked on the business execution code before the business execution code of the business to be executed is executed; and to obtain specified data of the associated business of the business to be executed as the context data of the business to be executed based on the information about the business rules.

[0016] The post-execution processing module for the business execution code is used to obtain execution result processing rules from the stub annotations after the business execution code is executed; and to process the execution result obtained by executing the business execution code according to the execution result processing rules to obtain target data related to the execution result.

[0017] The persistent data tracking module is used to associate and record the context data obtained by the pre-processing module for execution code and the target data obtained by the post-processing module for execution code.

[0018] A data processing apparatus, comprising:

[0019] The annotation acquisition unit is used to acquire the stub annotations marked on the business execution code of the business to be executed; the stub annotations are pre-set with: business rule information and execution result processing rules;

[0020] The context data acquisition unit is used to acquire specified data of the associated business of the business to be executed, based on the information of the business rules, before the business execution code is executed, as the context data of the business to be executed;

[0021] The target data acquisition unit is used to process the execution result obtained from executing the business execution code according to the execution result processing rules after the business execution code is executed, so as to obtain target data related to the execution result;

[0022] A recording unit is used to associate and record the context data and the target data.

[0023] A computing device includes: a memory and a processor, wherein,

[0024] The memory is used to store computer programs;

[0025] The processor, coupled to the memory, is used to execute the computer program stored in the memory for performing the methods described above.

[0026] A computer-readable storage medium storing a computer program that, when executed by a computer, enables the implementation of the above-described method.

[0027] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:

[0028] Because the business execution code is annotated with stub annotations, and business rule information and execution result processing rule information are set in the stub annotations, it is possible to obtain specified data of the business's related business based on the business rule information before executing the business execution code, as the context data of the business to be executed. After executing the business execution code, the execution result obtained from executing the business execution code is processed according to the execution result processing rules to obtain target data related to the execution result, and the context data and target data are associated and recorded, thereby realizing the recording of relevant data of the business.

[0029] In particular, compared with existing technologies that record relevant data for business operations, such as system logs or operation logs, the solution provided in this application has significant advantages in terms of the technical effect of "associating the context data of the business with the target data related to the execution result, thereby facilitating querying". It avoids the problem that the data of different businesses in the same business call chain are relatively isolated and difficult to associate through querying, which exists in the log recording method. Attached Figure Description

[0030] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0031] Figure 1 A flowchart illustrating a specific implementation of a data processing method provided in this application embodiment;

[0032] Figure 2 A diagram illustrating a scenario where a user interacts with a customer service robot;

[0033] Figure 3 This application provides a data processing system and a schematic diagram illustrating the data interaction process between the various modules included in the system.

[0034] Figure 4 A schematic diagram illustrating an example of the application of the method and system provided in this application in a scenario where a user and a customer service robot engage in multi-turn dialogue;

[0035] Figure 5 This is a schematic diagram of the specific structure of a data processing device provided in an embodiment of this application;

[0036] Figure 6 This is a schematic diagram of the specific structure of a computing device provided in an embodiment of this application. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0038] As will be known to those skilled in the art, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0039] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0040] Example 1

[0041] Embodiment 1 of this application provides a data processing method for recording target data related to the context data of a business and the execution results obtained from executing the business.

[0042] The execution subject of this method can be any computing device capable of implementing the method, such as a server, mobile phone, personal computer, smart wearable device, smart robot (such as customer service robot), etc.

[0043] Different steps of this method can be implemented by the same execution entity or by different execution entities. This application does not limit which execution entity is used to implement the method.

[0044] Furthermore, the embodiments of this application do not limit the execution order of different steps. When using the method provided in the embodiments of this application, the execution order of different steps can be adjusted according to actual needs.

[0045] For ease of description, the following uses a data processing system that can be embedded in a customer service robot as the execution subject of this method to provide a detailed description of the method provided in this application embodiment.

[0046] In this embodiment, the data processing system is embedded in the customer service robot. For example, the data processing system can be set as a software module within the customer service robot so that the robot can call and run it. Alternatively, the data processing system can be set in a hardware module as an external device accessible to the customer service robot, which can then call and run it.

[0047] like Figure 1 The diagram shown illustrates a specific implementation flow of a data processing method provided in this application embodiment, including the following steps:

[0048] Step 11: The data processing system obtains the stub annotations marked on the business execution code of the business to be executed;

[0049] The pending tasks mentioned here, for example, could be tasks that the customer service robot needs to perform during a conversation between a user and the robot. Since this task is in a state of not yet being executed in step 11, it is called a pending task.

[0050] like Figure 2 The image shows a scenario where a user interacts with a customer service robot. This interaction can be a single-turn or multi-turn conversation.

[0051] In such Figure 2 In the scenario shown, for example, if a user selects the "Confirm Early Repayment" option during the conversation, and then selects the "Get Loan Contract Details" option on the "Loan Contract Details Information Query Confirmation Page" pushed by the customer service robot, then the user's two selection actions will respectively trigger the customer service robot to perform two tasks: "pushing the 'Loan Contract Details Information Query Confirmation Page'" and "retrieving and pushing the contract numbers of each loan contract signed by the user."

[0052] Before execution, both of these services fall under the category of "services to be executed" as described in the embodiments of this application.

[0053] In this embodiment, the execution order of each service is related to the others, and services that belong to the same dialogue event (such as single-turn dialogue or multi-turn dialogue, which are both dialogue events) can be classified into the same "service call chain".

[0054] The initialization business in a business call chain generally refers to the first business executed after a dialogue event occurs; while the final business in a business call chain generally refers to the last business executed before the dialogue event terminates. After a dialogue event occurs, the initialization business, the final business, and the business whose execution time is between the execution time of the initialization business and the final business together constitute a business call chain.

[0055] A service call chain may contain multiple services or only one service. This application does not limit the number of services that constitute a service call chain.

[0056] The essence of executing business logic is to execute the business execution code. Business execution code refers to computer program code. By executing business execution code, computing devices can realize the corresponding business logic, that is, implement the corresponding business.

[0057] Generally, business execution code can be pre-set in a designated storage space, so that the data processing system can obtain the business execution code of the business to be executed from the storage space.

[0058] For example, taking the aforementioned business of "obtaining and pushing the contract numbers of each loan contract signed by the user" as an example, the data processing system can obtain the business execution code for this business in the following ways:

[0059] The data processing system can monitor whether business trigger conditions occur during the dialogue between the customer service robot and the user;

[0060] When a business trigger condition is detected during the session, the business triggered by the business trigger condition is taken as the business to be executed, and the business identifier of the business to be executed is obtained;

[0061] Based on the business identifier, query the pre-stored correspondence between the storage addresses of each business identifier and the business execution code;

[0062] The business execution code is obtained from the storage space represented by the queried storage address.

[0063] In this embodiment, considering that if data related to the business performed by the customer service robot needs to be recorded, it is necessary for the data processing system to know which data should be recorded for the current business. Therefore, for the business execution code of the business to be executed, pre-annotated stub points can be used to convey information such as "which data should be recorded" to the data processing system.

[0064] Pre-annotating business execution code with stubs can be achieved during the business execution code writing phase by using techniques such as stubbing (or instrumentation, or embedding) the business execution code.

[0065] In this embodiment of the application, stubling for business execution code can refer to assigning a unique identifier to the business execution code of a business to indicate that data related to that business needs to be recorded.

[0066] The unique identifier can be an annotation set for business execution code, and therefore can also be called a stub annotation.

[0067] The following table provides an exemplary description of the content that can be included in pile point annotations.

[0068] The name of the annotation content Description of the content of the annotation success-detail Description of successful execution of business logic code fail-detail Description of business logic execution failure action Business code behavior condition Execution result parsing rules category Business type persistence Persistence strategy

[0069] In the above table:

[0070] "Success-detail" and "fail-detail" refer to the descriptions of different types of execution results (such as success and failure) of the business logic code, including information about user-defined functions. Specifically, "success-detail" describes the successful execution of the business logic code, and "fail-detail" describes the failure of the business logic code.

[0071] A function is an independent unit of program code that performs a specific task. A function typically has a function name, parameters, and a return value. A user-defined function, on the other hand, is a function defined by the writer of the business logic code based on the desired functionality. Analyzing the execution of user-defined functions is generally of great interest given the need to analyze and mine business-related data.

[0072] An action refers to the behavior of business code, that is, the specific business content implemented by the business execution code. Taking the business logic "obtain and push the contract numbers of all loan contracts signed by the user" as an example, "obtaining the contract numbers of all loan contracts bound to the user ID based on the user ID currently provided by the user, and pushing them to the user" is the content of this business logic, or the business code action. Based on the business code action, user data related to the business can be obtained from the business execution code, such as the user ID and the contract numbers of all loan contracts bound to the user ID in the example above.

[0073] The condition refers to the execution result parsing rule. This rule defines how to handle the execution result obtained after the business logic code is executed.

[0074] Take the business execution code shown below, which is used to "determine whether the type of the current contract meets the limiting conditions", as an example:

[0075]

[0076]

[0077] The execution result of this business logic code is to return whether the condition is met (true / false).

[0078] Of course, the execution results often differ depending on the specific business execution code. This application does not limit either the business execution code or the corresponding execution results.

[0079] Category refers to the business type. Based on the business type of the business to be executed, information about the business rules corresponding to the business to be executed can be obtained. Then, based on the information about the business rules, the initialization business belonging to the same business call chain as the business to be executed can be determined. Subsequently, the specified data of the initialization business can be obtained as the context data of the business to be executed.

[0080] Persistence refers to a persistence strategy. A persistence strategy defines the specific persistent storage method used for at least one type of data in the associated records in step 14 below.

[0081] If the business execution code is annotated with stubs, the data processing system can obtain the stubs along with the business execution code, thus gaining access to the information shown in the table above. The following sections will further explain how this information functions.

[0082] Regarding step 11 above, in one optional implementation, the data processing system can intercept the business execution code before it is executed. For successfully intercepted business execution code, the data processing system can identify whether the business execution code is marked with stub annotations. If the business execution code is marked with stub annotations, the stub annotations can be obtained. If the business execution code is not marked with stub annotations, step 11 does not need to be executed; instead, the business execution code is allowed to proceed, or the functional module used to execute the business execution code is called to execute the business execution code.

[0083] Whether the business execution code has stub annotations can be determined by parsing the business execution code. For example, if the parsed business execution code contains stub annotation content, then the business execution code is determined to have stub annotations; otherwise, the business execution code is determined not to have stub annotations.

[0084] The identification of whether the business execution code is marked with stub annotations can be performed by the data processing system itself or by the data processing system calling other functional modules. This application embodiment does not limit the execution subject for performing this step.

[0085] In one alternative implementation, the data processing system can monitor business triggering events—such as monitoring whether business triggering conditions occur during the dialogue between the customer service robot and the user, as described above—and if a business triggering event is detected, the triggered business is taken as the business to be executed, and the business execution code of the business to be executed is intercepted before it is executed.

[0086] Specific interception methods may include, but are not limited to: pausing the execution of business logic code and obtaining the business logic code.

[0087] Step 12: Before the business execution code of the business to be executed is executed, the data processing system obtains the specified data of the related business of the business to be executed based on the information of the business rules contained in the stub annotation, and uses it as the context data of the business to be executed.

[0088] As shown in the table above, the stub annotations can include business categories. Since these business categories can represent information about business rules, they can serve as information for those rules.

[0089] Taking the task to be performed as "obtaining and pushing the contract numbers of each loan contract signed by the user" as an example, the specific implementation of step 12 may include the following sub-steps 121 to 123:

[0090] Sub-step 121: The data processing system obtains the information of the business rules corresponding to the business to be executed based on the business type of the business to be executed contained in the stub annotation;

[0091] The information in the business rules generally includes: the business identifiers of each business included in the same business call chain, and the execution order of each business in the same business call chain.

[0092] For example, if the stub annotation of the business execution code "obtain and push the contract number of each loan contract signed by the user" contains the business type "early repayment", then, based on this business type, by querying the pre-set correspondence between the business types and the business rules, the information of the business rules corresponding to "early repayment" can be obtained.

[0093] The information retrieved for this business rule may include, for example, the business identifiers “001”, “002”, “003” (indicating user selection) and “004” (indicating) of each business belonging to the same business call chain, as well as the execution order of these businesses in the business call chain, such as 001→002→003→004.

[0094] The correspondence between each identifier and specific business is as follows:

[0095] 001 corresponds to the "Push 'Loan Contract Details Information' Query Confirmation Page" service, which is the initialization service of the service call chain;

[0096] 002 corresponds to the service of "obtaining and pushing the contract numbers of each loan contract signed by the user";

[0097] 003 corresponds to the service of "determining the repayment amount based on the contract number selected by the user and sending it to the user".

[0098] 004 corresponds to the "calling third-party software for repayment" business, which is the final business in the business call chain.

[0099] Sub-step 122: The data processing system determines the initialization business that belongs to the same business call chain as the business to be executed, based on the information of the acquired business rules;

[0100] Continuing with the previous example, based on the execution order described above, we can determine that the business corresponding to 001 is the initialization business of this business chain.

[0101] Sub-step 123: The data processing system obtains the specified data for initializing the business and uses it as the context data for the business to be executed.

[0102] Continuing with the previous example, the specified data mentioned here may include, but is not limited to, the user identification data used when executing the "push 'loan contract details information' query confirmation page" service corresponding to 001. User identification data may include, for example, the user ID collected to verify user identity.

[0103] In this embodiment, the reason for the data processing system to obtain context data is that when analyzing or mining business-related data later, it is often not just about focusing on the data of a single business in isolation, but may combine the data of other businesses closely related to the business (especially those belonging to the same business call chain, such as initialization business) for analysis or mining. Therefore, context data can be obtained so that data association records can be made later.

[0104] In sub-step 123, the business identifier of the initialization business can be used as the query condition to query the correspondence between each pre-set business identifier and the data storage space access path. Then, based on the queried data storage space access path, the corresponding data storage space storing the specified data of the initialization business can be accessed to obtain the specified data.

[0105] It should be noted that in step 12, the reason why the data processing system obtains the specified data of the associated business before the business execution code of the business to be executed is that as the business to be executed is executed, the specified data of the associated business may be cleared or overwritten by other data, thus making it impossible to obtain.

[0106] Considering this situation, in step 12, the specified data of the associated business is obtained before the business execution code of the business to be executed, thereby avoiding data loss caused by the above situation. This is also one of the technical advantages of the method provided in the embodiments of this application.

[0107] Step 13: After the business execution code of the business to be executed is executed, the data processing system processes the execution result obtained from the execution of the business execution code according to the execution result processing rules, so as to obtain the target data related to the execution result;

[0108] Continuing with the example of the pile point annotation shown in the table above, the specific implementation process of step 13 is explained below.

[0109] The condition in the table above represents the execution result parsing rule, which defines how to handle the execution result obtained after the business execution code is executed.

[0110] For example, if the execution result parsing rule is "$data.time", it means retrieving the "time" field under the "data" field in the execution result as the target data related to the execution result. The data processing system can determine the specific content of the rule by parsing the business execution code, and then, based on that specific content, retrieve data matching that content from the execution result as the target data.

[0111] Generally, the execution results are stored / temporarily stored in a specified storage space, and the data processing system can retrieve the execution results from this storage space for processing.

[0112] As mentioned earlier, in one optional implementation, the data processing system can intercept the business execution code of the business to be executed. In this case, the data processing system can directly act as the execution entity for the business execution code. Alternatively, the data processing system can invoke a code executor to execute the business execution code, and the code executor can then execute the business execution code.

[0113] The execution timing of the business execution code for the pending business can be after the data processing system successfully obtains the context data.

[0114] Step 14: The data processing system associates and records the acquired context data and target data.

[0115] In step 14, the obtained context data and target data are associated and recorded. This can mean storing the context data and target data in different storage spaces with a mapping relationship, so that when querying the context data, the associated target data can be easily queried based on the mapping relationship.

[0116] Alternatively, the context data and the unique identifier of the business to be executed can be linked together, and the target data and the unique identifier of the business to be executed can also be linked together. This allows the unique identifier of the business to be executed to serve as the link between the context data and the target data. Thus, the unique identifier of the business to be executed can be used as a query condition to retrieve both the context data and the target data, thus identifying them as the linked context data and target data records.

[0117] The unique identifier of the service to be executed can be either the unique identifier of the service itself or the unique identifier of the service call chain to which the service belongs. In particular, when the service to be executed is the service performed when a user is having a conversation with a customer service robot, the unique identifier of the service to be executed can also be the unique identifier of that conversation.

[0118] Alternatively, the associated record can refer to combining and binding context data and target data. The combined and bound context data and target data can be placed in a data queue as the final tracking data, awaiting persistence processing.

[0119] As shown in the table above, in one optional implementation, the stub annotation may also include descriptions of different types of execution results of the business execution code, and the descriptions may include information about custom functions.

[0120] In such a case, the method provided in this application embodiment may further include: executing a custom function to obtain the execution result of the custom function.

[0121] The custom function is obtained from the description content included in the stub annotation.

[0122] For example, if the description of the business execution code failure contained in the stub annotation is: "No matching data after multiple rounds of early repayment dialogue: '{deveryResult{#data.success}}', the failure node is '{proccess())}}'", then the custom functions 'deveryResult{#data.success}' and 'proccess()' can be directly obtained from the description of the business execution code failure.

[0123] The execution of custom functions can be carried out by the data processing system calling the custom function executor.

[0124] In an optional implementation, to facilitate efficient execution of the custom function when the execution result needs to be obtained, and to reduce the resource consumption caused by repeatedly retrieving the custom function from the description when multiple executions are required, custom functions can be pre-extracted from the description and added to a custom function pool. For example, custom functions can be extracted from the description and added to the custom function pool while executing step 12. The custom function pool here can refer to a centralized storage space for custom functions.

[0125] Therefore, when it is necessary to execute a custom function to obtain the execution result, the custom function can be conveniently called from the custom function pool, and then the called custom function can be executed.

[0126] When the method provided in this application embodiment further includes obtaining the execution result by executing a custom function, the association record in step 13 may specifically include: associating the context data, the execution result, and the target data.

[0127] For details on how to associate records, please refer to the previous text; they will not be repeated here.

[0128] As shown in the table above, in one alternative implementation, the stub annotation may also include information about the business code behavior.

[0129] In this case, step 14, which involves associating and recording the context data and target data, may specifically include:

[0130] Based on the information of the business code behavior, obtain the user data associated with the business to be executed. For example, in the business "obtain and push the contract numbers of each loan contract signed by the user", "obtain the contract numbers of each loan contract bound to the user ID based on the user ID currently provided by the user, and push them to the user" is the content of this business, or the business code behavior. Based on the business code behavior, user data associated with the business can be obtained from the business execution code, such as user ID, contract numbers of each loan contract bound to the user ID, etc.

[0131] The context data, the target data, and the user data associated with the business to be executed, obtained based on the information of the business code behavior, are associated and recorded.

[0132] For details on how to associate records, please refer to the previous text; they will not be repeated here.

[0133] Of course, for cases where the stub annotation contains both the described content and the information about the business code behavior, step 14 can associate and record the context data, the target data, the user data, and the execution result. The specific method for associating and recording these elements can be found above and will not be repeated here.

[0134] In an optional implementation, when the service to be performed specifically includes the service to be performed by a customer service robot that interacts with the user, the method provided in this application embodiment may further include:

[0135] Before the business execution code is executed, basic data of the dialogue between the user and the customer service robot is obtained from the business execution code. The basic data of the dialogue may include, but is not limited to, one or more of the following: the user's intention expressed during the dialogue, the content of the dialogue, the channel of the dialogue (such as the identifier of the application software carrying the dialogue), the name of the business execution code, the file name of the folder where the business execution code is located, and the file access path.

[0136] Therefore, the association and recording of the context data and target data in step 14 may specifically include:

[0137] The basic data, the context data, and the target data are associated and recorded.

[0138] In an alternative implementation, as shown in the table above, the stub annotation may also include a persistence strategy, which defines the persistent storage method specifically used for at least one piece of data in the associated record.

[0139] The persistent storage methods mentioned here may include, but are not limited to, storing in MySQL (a relational database), logging based on at least one of the data, or storing in HBase (a distributed, column-oriented open-source database).

[0140] Based on the aforementioned persistence strategy, the data processing system can obtain at least one piece of data from the associated records and persist that at least one piece of data according to the persistence storage method defined in the persistence strategy. For example, the persistence strategy can be "[mysql,log]", which indicates that the persistence storage method is to store the at least one piece of data in MySQL and to print logs based on the at least one piece of data. Another example is the persistence strategy "[mysql]", which indicates that the persistence storage method is to store the at least one piece of data in MySQL, allowing the data processing system to directly call the MySQL mapper to perform the operation of storing at least one piece of data from the associated records in the MySQL database.

[0141] The context data, target data, user data, and execution results obtained in this application embodiment can all be referred to as event tracking data.

[0142] Using the method provided in this application embodiment, since the business execution code is annotated with stub annotations, and the stub annotations contain business rule information and execution result processing rule information, it is possible to obtain specified data of the business's related business according to the business rule information before executing the business execution code, and use it as the context data of the business to be executed; after executing the business execution code, the execution result obtained from executing the business execution code is processed according to the execution result processing rules to obtain target data related to the execution result, and the context data and target data are associated and recorded, thereby realizing the recording of relevant data of the business.

[0143] In particular, compared with existing technologies such as system logs or operation logs that can perform some related data processing for business, the solution provided in this application has significant advantages in terms of the technical effect of "associating the context data of the business with the target data related to the execution result, thereby facilitating querying". It avoids the problem that the data of different businesses in the same business call chain are relatively isolated and difficult to associate through querying in the log recording method.

[0144] Example 2

[0145] Based on the same inventive concept as the method provided in Embodiment 1 of this application, in order to realize the recording of target data related to the context data of the business and the execution results obtained from the execution of the business, Embodiment 2 of this application provides a data processing system.

[0146] The specific structural diagram of the system is as follows: Figure 3 As shown, the system mainly comprises four modules: a business interceptor 31, a pre-processing module for execution code 32, a post-processing unit for business execution code 33, and a persistent data management module for data tracking 34. The business interceptor 31 is an optional, rather than essential, module in this system, depending on actual needs.

[0147] The specific functions of each module are detailed below:

[0148] The business interceptor 31 is mainly used to intercept the business execution code before the business execution code of the business to be executed is executed; if it is identified that the business execution code is marked with a stub annotation, then the stub annotation is provided to the pre-processing module 32 of the execution code and to the post-processing module 33 of the execution code.

[0149] The code preprocessing module 32 is used to obtain business rule information from the stub annotations marked on the business execution code before the business execution code is executed; and to obtain the specified data of the associated business of the business to be executed as the context data of the business to be executed based on the information of the business rules.

[0150] Optionally, in one implementation, the information of the business rule can be carried in the business type information set in the stub annotation. In this case, the code preprocessing module 32 can specifically be used for:

[0151] Obtain business type information from stub annotations;

[0152] Based on the business type information, determine the business rule information corresponding to the business type information;

[0153] Based on the information in the business rules, identify the initialization business that belongs to the same business call chain as the business to be executed;

[0154] Retrieve the specified data for initializing the business logic, and use it as the context data for the business logic to be executed.

[0155] The business execution code post-processing unit 33 is used to obtain the execution result processing rules from the stub annotation after the business execution code is executed; and to process the execution result obtained by executing the business execution code according to the execution result processing rules to obtain target data related to the execution result.

[0156] The data persistence module 34 is used to associate and record the context data obtained by the pre-processing module for the execution code and the target data obtained by the post-processing module for the execution code.

[0157] Optionally, in one implementation, the stub annotation may also include: descriptions of different types of execution results of the business execution code; the descriptions include information about custom functions.

[0158] In this case, the post-processing module 33 for executing business execution code can be specifically used for:

[0159] Execute the custom function obtained based on the information of the custom function to obtain the execution result of the custom function on the data to be processed.

[0160] Correspondingly, the data persistence module 34 can be used to associate and record the context data, the execution result of the custom function on the data to be processed, and the target data.

[0161] Optionally, in one implementation, the code preprocessing module 32 can also be used to: extract the custom function from the description content and add it to the custom function pool.

[0162] In this case, the business execution code post-processing module 33 can be specifically used to: call the custom function from the custom function pool; and execute the called custom function.

[0163] Optionally, in one implementation, the stub annotation may also include information about the business code behavior.

[0164] In this case, the code preprocessing module 32 can also be used to obtain user data associated with the business to be executed based on the information of the business code behavior.

[0165] Correspondingly, the data persistence module 34 can be used to associate and record the context data and user data obtained by the code preprocessing module 32 and the target data obtained by the code postprocessing module 33.

[0166] Optionally, if the business to be executed includes a customer service robot business to be executed that interacts with the user, the code preprocessing module 32 can also be used to obtain basic data of the dialogue between the user and the customer service robot from the business execution code before the business execution code is executed.

[0167] Correspondingly, the data persistence module 34 can be used to associate and record the basic data, the context data, and the target data.

[0168] Optionally, the stub annotation can also include information about the persistence strategy.

[0169] In this case, the data persistence module 34 can also be used to persistently store at least one type of data in the associated records according to the persistence strategy.

[0170] Please refer to the instruction manual appendix. Figure 3 Taking the execution of business logic triggered during a conversation between a user and a customer service robot as an example, the data processing system provided in this application embodiment can include the following steps in the process of recording and persisting data:

[0171] Step 301: When the business interceptor 31 detects that a business (business to be executed) is triggered during the conversation between the user and the customer service robot, it obtains the business execution code of the business to be executed and identifies whether the business execution code has stub annotations. If it does, then step 302 is executed.

[0172] In Embodiment 2 of this application, assuming that the business to be executed is "to obtain and push the contract number of each loan contract signed by the user", and assuming that the business execution code of this business is set with stub annotations as shown in the table above, then step 302 can be executed.

[0173] Step 302: The business interceptor 31 intercepts the business execution code of the business to be executed;

[0174] Step 303: The business interceptor 31 sends the business execution code of the business to be executed to the execution code pre-processing module 32;

[0175] Step 304: The code preprocessing module 32 obtains the corresponding data based on the business execution code of the business to be executed and the information set in the stub annotation of the business execution code;

[0176] Step 304 may specifically include the following:

[0177] 1. Obtain basic data of the dialogue between the user and the customer service robot from the business execution code;

[0178] 2. Obtain information about the business code behavior from the stub annotations; based on the information about the business code behavior, obtain the user data of the initialization business that belongs to the same business call chain as the business to be executed;

[0179] 3. Obtain business type information from stub annotations; determine the business rule information corresponding to the business type information based on the business type information; determine the initialization business belonging to the same business call chain as the business to be executed based on the business rule information; obtain the specified data of the initialization business as the context data of the business to be executed.

[0180] 4. Parse the successful execution description of the business execution code set in the stub annotation to obtain the custom function; put the custom function into the custom function pool.

[0181] Step 305: The code preprocessing module 32 will package and structure the acquired basic data, user data, and context data into preprocessing data for storage.

[0182] Step 306: The code preprocessing module 32 calls the business execution code executor to execute the business execution code and obtain the execution result;

[0183] Step 307: The post-processing module 33 of the business execution code obtains the execution result parsing rules from the stub annotations, processes the execution results according to the execution result processing rules, and obtains the target data related to the execution results;

[0184] Step 308: The business execution code post-processing module 33 retrieves the custom function obtained and placed by the execution code pre-processing module 32 from the custom function pool;

[0185] Step 309: The business execution code post-processing module 33 calls the custom function runner to run the custom function obtained from the custom function pool, so as to obtain the running result of the custom function;

[0186] Step 310: The business execution code post-processing module 33 obtains the stored pre-processing data;

[0187] Step 311: The business execution code post-processing module 33 combines the pre-processed data and the execution result of the custom function, and uses the combined data as the final tracking data, storing it in, for example, a data queue, waiting for the tracking data persistence module 34 to consume it;

[0188] Step 312: The event tracking data persistence module 34 retrieves the final event tracking data;

[0189] Step 313: The embedding data persistence module 34 obtains the persistence strategy from the pile annotation;

[0190] Step 314: The event tracking data persistence module 34 performs persistence processing on the final event tracking data according to the obtained persistence strategy.

[0191] The system provided in this application embodiment, by annotating the business execution code with stub annotations and setting business rule information and execution result processing rule information in the stub annotations, can obtain specified data of the business's related business according to the business rule information before executing the business execution code, as the context data of the business to be executed; and after executing the business execution code, process the execution result obtained from executing the business execution code according to the execution result processing rules to obtain target data related to the execution result, and associate and record the context data and target data, thereby realizing the recording of relevant data of the business.

[0192] In particular, compared with existing technologies that record relevant data for business operations, such as system logs or operation logs, the solution provided in this application has significant advantages in terms of the technical effect of "associating the context data of the business with the target data related to the execution result, thereby facilitating querying". It avoids the problem that the data of different businesses in the same business call chain are relatively isolated and difficult to associate through querying, which exists in the log recording method.

[0193] Example 3

[0194] This application provides an example of applying the methods and systems provided in embodiments 1 and 2 to a scenario where users and customer service robots engage in multi-turn dialogues.

[0195] like Figure 4The diagram shown is a schematic representation of the entities involved in the example described in Embodiment 3 of this application and their data interaction.

[0196] Figure 4 The entities in the code include: users, the chatbot's dialogue engine, the gateway (xmagateway), and interceptors.

[0197] The data interaction process between entities may include the following steps:

[0198] Step 41: When a user wants to have a multi-turn conversation with the chatbot's dialogue engine, they send a multi-turn conversation request to the dialogue engine.

[0199] Step 42: Suppose that a conversation in a multi-turn dialogue triggers the "metadata retrieval" service, then the dialogue engine sends a metadata retrieval request to the gateway;

[0200] Step 43: In response to the metadata call request, the gateway triggers an interceptor to intercept the business execution code of the service before executing the "metadata call" service.

[0201] Step 44: The interceptor determines whether the business execution code of the service has stub annotations set; if not, it directly allows the business execution code to be executed by the gateway; if so, it notifies the gateway of the determination result, so that the gateway further triggers the interceptor to read the stub annotations.

[0202] Step 45: The interceptor provides the stub annotations it reads and the intercepted business execution code to the execution code pre-processing module set in the gateway for processing, so as to obtain the pre-processing data as described in Example 3 for storage;

[0203] Step 46: After the interceptor has completed the storage of the preceding data, it triggers the gateway to execute the business execution code of the service, thereby obtaining the execution result of the service—including the acquisition of metadata and the specific metadata acquired;

[0204] Step 47: The gateway sends the obtained metadata to the engine;

[0205] Step 48: The engine sends the metadata to the user;

[0206] Step 49: The interceptor provides the read stub annotations to the business execution code post-processing module set in the gateway; the business execution code post-processing module performs data processing based on the stub annotations, the execution results and the preceding data (see Embodiment 3 for details, which will not be repeated here) to obtain the final embedded data as described in Embodiment 3 and put it into the data queue.

[0207] Step 49 can be performed after step 46, simultaneously with step 47 or step 48.

[0208] Step 410: The persistent tracking module set in the interceptor consumes the final tracking data from the data queue according to the persistence strategy in the stub annotation.

[0209] As can be seen from the example provided in Embodiment 3 of this application, when the method / system provided in the embodiments of this application is applied to a real-world scenario, the entities where each module is located can be flexibly set, for example, they can be set in a gateway.

[0210] Example 4

[0211] In order to record the context data of the business and the target data related to the execution results obtained from the execution of the business, based on the same inventive concept as the above embodiments of this application, Embodiment 4 of this application provides a data processing device.

[0212] A schematic diagram of the specific structure of the device is shown below. Figure 5 As shown, it includes the following functional units:

[0213] Annotation acquisition unit 51 is used to acquire the stub annotations marked on the business execution code of the business to be executed; the stub annotations are pre-set with: business rule information and execution result processing rules;

[0214] The context data acquisition unit 52 is used to acquire, before the business execution code is executed, the specified data of the associated business of the business to be executed, based on the information of the business rule pre-set in the stub annotation acquired by the annotation acquisition unit 51, as the context data of the business to be executed;

[0215] The target data acquisition unit 53 is used to process the execution result obtained by executing the business execution code according to the execution result processing rules pre-set in the stub annotations acquired by the annotation acquisition unit 51 after the business execution code is executed, so as to obtain target data related to the execution result.

[0216] Recording unit 54 is used to associate and record the context data and target data.

[0217] In one optional implementation, the annotation acquisition unit 51 can specifically be used for:

[0218] Before the business execution code is executed, the business execution code is intercepted; if the business execution code is identified to be marked with the stub annotation, the stub annotation is obtained.

[0219] In an optional implementation, the apparatus provided in this application may further include: a business execution code execution unit, used to execute the intercepted business execution code to obtain the execution result.

[0220] In one optional implementation, the information of the business rule can be carried in the business type information set in the stub annotation; correspondingly:

[0221] Context data acquisition unit 52 can be specifically used for:

[0222] The business type information is obtained from the stub annotation; the business rule information corresponding to the business type information is determined based on the business type information; the initialization business belonging to the same business call chain as the business to be executed is determined based on the business rule information; and the specified data of the initialization business is obtained as the context data of the business to be executed.

[0223] In an optional implementation, the stub annotation may further include: descriptions of different types of execution results of the business execution code; the descriptions include information about custom functions. The target data acquisition unit 53 may also be used for:

[0224] Execute the custom function obtained based on the information of the custom function to obtain the execution result of the custom function for the data to be processed.

[0225] Correspondingly, the recording unit 54 can be specifically used to: associate and record the context data, the execution result, and the target data.

[0226] In an optional implementation, the context data acquisition unit 52 can also be used to: extract the custom function from the description content and add it to the custom function pool. Correspondingly, the target data acquisition unit 53 can specifically be used to:

[0227] From the custom function pool, call the custom function; execute the called custom function.

[0228] In an optional implementation, the stub annotation further includes information on business code behavior; correspondingly, the recording unit 54 can be specifically used for:

[0229] Based on the information about the business code behavior, obtain the user data associated with the business to be executed; and record the association between the context data, the target data, and the user data.

[0230] In an optional implementation, the stub annotation further includes information on the persistence strategy; correspondingly, the apparatus provided in this application embodiment may further include:

[0231] The persistence unit is used to persistently store at least one type of data among the data associated with the recording unit 54 in accordance with the persistence strategy.

[0232] In one optional implementation, the service to be executed includes: a customer service robot service to be executed in dialogue with the user. The context data acquisition unit 52 can also be used for:

[0233] Before the business execution code is executed, basic data of the dialogue between the user and the customer service robot is obtained from the business execution code.

[0234] Correspondingly, the recording unit 54 can be specifically used to: associate and record the basic data, the context data, and the target data.

[0235] The functional implementation of each functional module of the device provided in this application embodiment can be referred to the relevant descriptions in Embodiment 1 and Embodiment 2, and will not be repeated here.

[0236] Using the apparatus provided in this application embodiment, since the business execution code is annotated with stub annotations and the stub annotations contain information on business rules and execution result processing rules, it is possible to obtain specified data of the business's associated business based on the information of the business rules before executing the business execution code, and use this data as context data for the business to be executed. After executing the business execution code, the execution result obtained from executing the business execution code is processed according to the execution result processing rules to obtain target data related to the execution result, and the context data and target data are associated and recorded, thereby realizing the recording of relevant data for the business.

[0237] In particular, compared with existing technologies that record relevant data for business operations, such as system logs or operation logs, the device provided in this application has significant advantages in terms of "associating the context data of the business with the target data related to the execution result, thereby facilitating querying". It avoids the problem that the data of different businesses in the same business call chain are relatively isolated and difficult to associate through querying, which exists in the log recording method.

[0238] Example 4

[0239] Based on the same inventive concept as the foregoing embodiments of this application, Embodiment 4 of this application provides a computing device for recording target data related to the context data of a service and the execution results obtained from executing the service.

[0240] like Figure 5 As shown, the computing device includes a memory 61 and a processor 62. The memory 61 can be configured to store various other data to support operation on the electronic device. Examples of such data include instructions for any application or method used to operate on the electronic device. The memory 61 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0241] The processor 62, coupled to the memory 61, is used to execute the computer program stored in the memory 61 to perform a sample data enhancement method as described in Embodiment 1 of this application, or a model training method or classification method as described in Embodiment 2 of this application.

[0242] When the processor 62 executes the computer program in the memory 61, in addition to the functions described above, it can also perform other functions, as detailed in the descriptions of the preceding embodiments.

[0243] Furthermore, such as Figure 6 As shown, the computing device also includes other components such as a display 64, a communication component 63, a power supply component 65, and an audio component 66. Figure 6 The diagram only shows some components and does not mean that the computing device includes only these components. Figure 6 The components shown.

[0244] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a computer, can implement the methods provided in the above embodiments.

[0245] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0246] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0247] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A data processing method, characterized in that, include: Retrieve the stub annotations marked on the business execution code corresponding to the business to be executed; The stub annotation is pre-set with: business rule information and execution result processing rules; the business rules include: the business identifiers of each business contained in the business call chain to which the business to be executed belongs, and the execution order of each business in the business call chain; Before the business execution code is executed, specified data of the associated business of the business to be executed is obtained according to the information of the business rules, and used as the context data of the business to be executed; After the business execution code is executed, according to the execution result processing rules, data that matches the execution result processing rules is obtained from the execution result obtained from executing the business execution code and used as target data; The context data and target data are associated and recorded.

2. The method as described in claim 1, characterized in that, The stub annotations annotated with the business execution code of the business to be executed include: Intercept the business execution code before it is executed; If the business execution code is identified as having the stub annotation, then the stub annotation is obtained.

3. The method as described in claim 1, characterized in that, The information of the business rules is carried in the business type information set in the pile annotation; Based on the information in the business rules, specified data of the associated business of the business to be executed is obtained as the context data of the business to be executed, including: The business type information is obtained from the station annotations; Based on the business type information, determine the business rules corresponding to the business type information; Based on the business rules, determine the initialization business that belongs to the same business call chain as the business to be executed; Obtain the specified data for the initialization service, and use it as the context data for the service to be executed.

4. The method as described in claim 1, characterized in that, The stub annotation also includes descriptions of different types of execution results for the business execution code; these descriptions include custom functions. The method further includes: Execute the custom function obtained based on the information of the custom function, and obtain the execution result of the custom function for the data to be processed; The process of associating and recording the context data and target data includes: The context data, the execution result, and the target data are associated and recorded.

5. The method as described in claim 4, characterized in that, The method further includes: extracting the custom function from the description and adding it to the custom function pool; Executing the custom function obtained based on the information of the custom function includes: Call the custom function from the custom function pool; Execute the custom function that was called.

6. The method as described in claim 1, characterized in that, The stub annotation also includes information about the behavior of the business code. The associated recording of the context data and target data also includes: Based on the information about the business code behavior, obtain the user data associated with the business to be executed; The context data, the target data, and the user data are associated and recorded.

7. The method according to any one of claims 1 to 6, characterized in that, The stub annotation also includes information on the persistence strategy. The method further includes: persistently storing at least one type of data in the associated record data according to the persistence strategy.

8. The method as described in claim 7, characterized in that, The pending tasks include: pending tasks of the customer service robot that interacts with the user; the method further includes: Before the business execution code is executed, basic data of the dialogue between the user and the customer service robot is obtained from the business execution code; The association and recording of the context data and target data includes: The basic data, the context data, and the target data are associated and recorded.

9. A data processing system, characterized in that, The system includes: a code pre-processing module, a business code post-processing module, and a data persistence module, wherein: The pre-processing module for the execution code is used to obtain information about business rules from the stub annotations marked on the business execution code before the business execution code of the business to be executed is executed; and to obtain specified data of the associated business of the business to be executed as the context data of the business to be executed based on the information about the business rules; wherein, the business rules include: the business identifiers of each business contained in the business call chain to which the business to be executed belongs, and the execution order of each business in the business call chain; The post-execution processing module for the business execution code is used to obtain execution result processing rules from the stub annotations after the business execution code is executed; and to obtain data matching the execution result processing rules from the execution results obtained from executing the business execution code, based on the execution result processing rules, as target data. The persistent data tracking module is used to associate and record the context data obtained by the pre-processing module for execution code and the target data obtained by the post-processing module for execution code.

10. A data processing apparatus, characterized in that, include: The annotation retrieval unit is used to retrieve the stub annotations marked on the business execution code of the business to be executed; The annotation of the stub points is pre-set with: business rule information and execution result processing rules; The business rules include: the business identifiers of each business contained in the business call chain to which the business to be executed belongs, and the execution order of each business in the business call chain; The context data acquisition unit is used to acquire specified data of the associated business of the business to be executed, based on the information of the business rules, before the business execution code is executed, as the context data of the business to be executed; The target data acquisition unit is used to acquire data that matches the execution result processing rule from the execution result obtained after the business execution code is executed, and use it as target data; A recording unit is used to associate and record the context data and the target data.

11. A computing device, characterized in that, include: Memory and processor, among which, The memory is used to store computer programs; The processor, coupled to the memory, is configured to execute the computer program stored in the memory for performing the method according to any one of claims 1 to 8.

12. A computer-readable storage medium storing a computer program, which, when executed by a computer, enables the implementation of the method described in any one of claims 1 to 8.