Data processing method and device, computer equipment, storage medium and computer program product
By parsing the target code text to generate an interface information table and automatically generating interface proxy classes, the problem of high complexity in A/B test code development is solved, achieving efficient code development and interface scalability.
Patent Information
- Application Number
- CN202510956592.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-11-07
AI Technical Summary
The code development for A/B testing in existing technologies is highly complex, especially when there are a large number of products or designs, making the implementation process cumbersome.
By parsing the target code text, the interface annotation information and interface path information are extracted to generate an interface information table. Based on this, an interface proxy class is automatically generated to call the corresponding version of the module interface when an account data processing request is received.
It reduces code development complexity, improves development efficiency and interface scalability, and can still be implemented efficiently, especially when there are a large number of products or designs.
Smart Images

Figure CN120909678A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a data processing method and device, computer equipment, storage medium and computer program product. BACKGROUND
[0002] AB testing is a method for comparing two or more versions of a product or design to determine which one is more effective. It evaluates the effectiveness of different versions by randomly assigning user accounts to different groups (e.g., Group A and Group B), and then comparing the behavior data of users in each group. The server determines the group to which the user account belongs based on the user account request, and matches the page resources corresponding to the A version if the user account belongs to Group A, or matches the page resources corresponding to the B version if the user account belongs to Group B. In the related art, the above logic is written into the code manually, and when the number of products or designs is large, the implementation process is relatively cumbersome. SUMMARY
[0003] Therefore, it is necessary to provide a data processing method, device, computer equipment, computer readable storage medium and computer program product capable of reducing code development complexity to solve the above technical problems.
[0004] In a first aspect, the present application provides a data processing method. The method comprises:
[0005] Obtaining target code text, parsing and extracting interface annotation information and interface path information corresponding to each module in the target code text to obtain an interface information table; wherein the interface annotation information at least includes version information;
[0006] Based on the interface information table, generating an interface proxy class of each module; wherein the interface proxy class is used to call the module interface corresponding to the version of the account when receiving a data processing request of the account.
[0007] In one of the embodiments, the parsing and extracting of the interface annotation information and the interface path information corresponding to each module in the target code text comprises:
[0008] Splitting the target code text to obtain each structural unit;
[0009] Based on the standard syntax rules corresponding to the code language of the target code text, determining a key structural unit from each structural unit, and based on the key structural unit and the dependency relationship of the key structural unit, determining a syntax tree; wherein the key structural unit includes an interface;
[0010] Based on the syntax tree, interface annotation information and interface path information corresponding to each module are identified respectively; wherein, the interface annotation information corresponds to a standard annotation identifier, and the annotation identifier is set at the interface declaration of the corresponding interface.
[0011] In one of the embodiments, the interface annotation information further includes interface type and parameter type, and after the identification of the interface annotation information and the interface path information corresponding to each module, the following steps are further included:
[0012] Based on the business specification, the interface annotation information corresponding to each module is detected;
[0013] In the case that the interface annotation information of the same interface corresponding to at least two modules is not the same, a compilation error prompt is displayed.
[0014] In one of the embodiments, the interface information table further includes the generation of the interface proxy class of each module based on the interface information table, including:
[0015] Based on the interface annotation information in the interface information table, corresponding interface annotation information is added at the declaration of the target interface of the interface proxy class;
[0016] Based on the method name of the target interface in the interface information table and the corresponding interface path information, the interface proxy class of each module is generated.
[0017] In one of the embodiments, the interface annotation information further includes interface type, and after the generation of the interface proxy class of each module based on the interface information table, the following steps are further included:
[0018] In the case that the data processing request of the account is received, the version information corresponding to the account is obtained;
[0019] Based on the target calling instruction, the interface proxy class is called to instruct the interface proxy class to call the matched module interface based on the version information corresponding to the account; wherein, the interface type is declared in the target calling instruction.
[0020] In one of the embodiments, after the interface information table is obtained by analyzing and extracting the interface annotation information and the interface path information corresponding to each module in the target code text, the following steps are further included:
[0021] The interface information table is converted into a dynamic configuration table;
[0022] The instruction of the interface proxy class to call the matched module interface based on the version information corresponding to the account includes:
[0023] The interface proxy class is instructed to call a matched module interface based on version information corresponding to the account and the dynamic configuration table.
[0024] In a second aspect, the present application further provides a data processing device, the device comprising:
[0025] An obtaining module is configured to obtain target code text, parse and extract interface annotation information and interface path information corresponding to each module in the target code text, and obtain an interface information table, wherein the interface annotation information at least includes version information.
[0026] A generating module is configured to generate an interface proxy class of each module based on the interface information table, wherein the interface proxy class is configured to call a module interface corresponding to a version of an account when receiving a data processing request of the account.
[0027] In one embodiment, the obtaining module is further configured to:
[0028] The target code text is split to obtain each structural unit.
[0029] Based on a standard syntax rule corresponding to a code language of the target code text, a key structural unit is determined from each structural unit, and a syntax tree is determined based on the key structural unit and a dependency relationship of the key structural unit, wherein the key structural unit includes an interface.
[0030] Based on the syntax tree, interface annotation information and interface path information corresponding to each module are identified, wherein the interface annotation information corresponds to a standard annotation identifier, and the annotation identifier is set at an interface declaration of the corresponding interface.
[0031] In one embodiment, the obtaining module is further configured to:
[0032] Based on a business specification, the interface annotation information corresponding to each module is detected.
[0033] In a case where interface annotation information corresponding to the same interface of at least two modules is not the same, a compilation error prompt is displayed.
[0034] In one embodiment, the obtaining module is further configured to:
[0035] Based on the interface annotation information in the interface information table, corresponding interface annotation information is added at a declaration of a target interface of the interface proxy class.
[0036] Based on a method name of the target interface in the interface information table and corresponding interface path information, the interface proxy class of each module is generated.
[0037] In one of the embodiments, the apparatus further comprises a calling module,
[0038] The calling module is configured to acquire version information corresponding to the account in response to receiving a data processing request of the account.
[0039] The interface proxy class is called based on the target calling instruction to instruct the interface proxy class to call a matched module interface based on the version information corresponding to the account, and the interface type is explicitly declared in the target calling instruction.
[0040] In one of the embodiments, the calling module is further configured to:
[0041] convert the interface information table into a dynamic configuration table;
[0042] instruct the interface proxy class to call a matched module interface based on the version information corresponding to the account and the dynamic configuration table.
[0043] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method in any of the embodiments of the present application when executing the computer program.
[0044] In a fourth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method in any of the embodiments of the present application.
[0045] In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program, and the computer program is executed by a processor to implement the method in any of the embodiments of the present application.
[0046] The aforementioned data processing methods, apparatus, computer equipment, storage media, and computer program products, by setting interface annotation information at the interfaces corresponding to each module, wherein the interface annotation information includes at least version information, allow for the extraction of interface annotation information and interface path information during target code parsing. This information is then written into an interface information table. The interface information table includes global interface annotation information and interface path information, based on which interface proxy classes can be automatically generated. These interface proxy classes are used to call the module interface corresponding to the account's version when a data processing request for that account is received. This eliminates the need for developers to write specific code describing which version of the interface to use for each target account, thus improving code development efficiency. Furthermore, the processes of parsing and extracting interface registration information and interface path information, as well as generating interface proxy classes, can all be automated. Even with a large number of products or designs, or continuous interface updates, this process remains highly efficient, further enhancing code development efficiency and interface scalability. Attached Figure Description
[0047] Figure 1 This is a flowchart illustrating a data processing method in one embodiment;
[0048] Figure 2 This is a flowchart illustrating the data processing method in another embodiment;
[0049] Figure 3 This is a flowchart illustrating the data processing method in another embodiment;
[0050] Figure 4 This is a structural block diagram of a data processing device in one embodiment;
[0051] Figure 5 This is an internal structural diagram of a computer device in one embodiment;
[0052] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] In one embodiment, such as Figure 1 As shown, a data processing method is provided. This embodiment illustrates the method applied to a terminal, but it is understood that the method can also be applied to a server, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0055] In step S101, a target code text is obtained, and interface annotation information and interface path information corresponding to each module in the target code text are parsed and extracted to obtain an interface information table. The interface annotation information at least includes version information.
[0056] The module (Module) can be a core unit of code organization and architecture design, which splits the system into functional units that can be independently developed, tested and maintained through the principle of high cohesion and low coupling. In the module, specific code logic, data structure and algorithm are usually included. The interface (Interface) can be a kind of behavior contract specification, which only includes method signature and no specific implementation, and is publicly exposed by defining access entry. The modules can communicate through the interface.
[0057] In the target code text, the interface annotation information can be located at a preset position of the interface, such as the interface declaration. The interface annotation information corresponds to preset identification information, so as to distinguish other codes. Optionally, the interface annotation information is represented as: @HarmonyInterface(type = "UserService", version = 1.0, model="user"). The interface path information is used to uniquely identify an interface, so as to accurately reference the interface in the code. The interface path is represented as: com.example.InterfaceName. The symbol "." separates the package name and the class name. In the embodiment of the present disclosure, the interface annotation information at least includes version information, for example: version = 1.0.
[0058] In an example embodiment, the interface annotation information and the interface path information are written into the interface information table, and the interface information table can be in JSON format, for example: interface-registry.json. The data in the interface information table can be stored in an object structure or an array structure. The object is a set of unordered key-value pairs (Key-Value Pair) wrapped in curly braces {}. The key must be a string and must be wrapped in double quotes; the value can be a string, a number, a boolean value, an object, an array or null. The key-value pairs are separated by commas. The array is an ordered set of values wrapped in square brackets []. The elements can be strings, numbers, boolean values, objects, arrays or null, and the elements are separated by commas.
[0059] In step S103, the interface proxy classes of the modules are generated based on the interface information table.
[0060] The interface proxy class is configured to invoke the module interface corresponding to the version of the account when receiving a data processing request of the account.
[0061] In the embodiments of the present disclosure, the interface proxy class of each module can be automatically generated based on the interface information table. In an exemplary embodiment, the information in the interface information table is written in the code corresponding to the interface proxy class in the format of a class to obtain the interface proxy class. Exemplarily, the interface proxy class can be represented as follows:
[0062] / / Proxy factory core
[0063] class HarmonyProxyFactory {
[0064] static getService <t>(interfaceName: IService): T {
[0065] return new Proxy({}, {
[0066] get(target, method: string) {
[0067] return (...args: any[]) => {
[0068] In the implementation process, the interface proxy class can also be increased in the module communication description, such as data format conversion, thread switching, etc. Among them, the data format conversion refers to converting the text data in json format into the object data in js format. Thread switching, for example, time-consuming operation, asynchronous operation, specifically, for example, the terminal needs to read local data or network data, in order to not let the terminal card segment, the current operation corresponds to the current thread processing, other operation corresponds to another thread processing.
[0069] In the above embodiment, the interface annotation information is set at the interface corresponding to each module, wherein the interface annotation information at least includes version information. When the target code is parsed, the interface annotation information and the interface path information can be extracted and written into the interface information table. The interface information table includes global interface annotation information and interface path information, based on which the interface proxy class can be automatically generated. The interface proxy class is used to call the module interface corresponding to the version of the account when receiving the data processing request of the account. In this way, the developer does not need to specially write code description for the target account and which version of the interface to use. The code development efficiency is improved. Further, the above process of parsing and extracting interface registration information and interface path information and the process of generating interface proxy class can be automatically implemented by program. When the number of products or designs is large, or the interface is constantly updated, it can still be efficiently implemented, improving the code development efficiency and interface scalability.
[0070] In one embodiment, referring to Figure 2 As shown, the parsing and extracting the interface annotation information and the interface path information corresponding to each module in the target code text comprises:
[0071] Step S201, the target code text is split to obtain each structure unit.
[0072] The structural unit is used to represent the minimum unit of code splitting, which can be a keyword, an identifier, or a symbol, etc. In an example embodiment, a piece of code is represented as follows: import { foo} from '. / bar.js'. The structural units obtained after splitting can include: import; {; foo; from; ' / bar.js'.
[0073] In step S203, a key structural unit is determined from the structural units based on the standard syntax rule corresponding to the code language of the target code text, and a syntax tree is determined based on the key structural unit and the dependency relationship of the key structural unit; the key structural unit includes an interface.
[0074] The standard syntax rule corresponding to the code language, for example, the standard syntax rule of the JavaScript language, can be the ECMAScript specification. It can be understood that the code language in the case can also be other code programming languages, such as C language, C++ language, and the embodiments of the present disclosure do not limit this.
[0075] The key structural unit can be import, export, interface, etc. In the extraction process, the position, type, and child node of the key structural unit can also be obtained. Optionally, the code can be parsed by a compiler to obtain an abstract syntax tree (AST).
[0076] In step S205, interface annotation information and interface path information corresponding to an interface of each module are identified based on the syntax tree; the interface annotation information corresponds to a standard annotation identifier, and the annotation identifier is set at the interface declaration of the corresponding interface.
[0077] In the embodiments of the present disclosure, the standard annotation identifier is used to mark the interface annotation information, for example: @HarmonyInterface. The standard annotation identifier can be placed above the interface declaration. Based on the above syntax tree, the interface annotation information and the interface path information corresponding to the global interface can be obtained.
[0078] In the above embodiments, the target code text is split to obtain the structural units. The key structural unit is determined from the structural units based on the standard syntax rule corresponding to the code language of the target code text, and the syntax tree is determined based on the key structural unit and the dependency relationship of the key structural unit. The interface annotation information and the interface path information corresponding to the interface of each module are identified based on the syntax tree. The interface path information can be quickly obtained from the global interface dependency relationship without manual operation, and the information extraction is automatically completed.
[0079] In an embodiment, the interface annotation information further comprises an interface type and a parameter type, and after identifying the interface annotation information and the interface path information corresponding to the interfaces of the respective modules, the method further comprises:
[0080] Based on the business specification, the interface annotation information of the respective modules is detected;
[0081] In the case that the interface annotation information of the same interface corresponding to at least two modules is not the same, a compilation error prompt is displayed.
[0082] In the embodiments of the present disclosure, the interface annotation information can further comprise an interface type and a parameter type, wherein the interface type is used to define the uniqueness of the interface together with the interface name, and the parameter type is used to represent the parameter name of the method in the interface. In an exemplary embodiment, the parameter name and the interface can be subjected to business specification verification based on the business specification to meet the iteration requirements, for example, the user module calls the method with the user prefix, so as to facilitate the identification of which module exposes the interface.
[0083] In an exemplary embodiment, for the same interface, for example, the User interface, in the A module, the exposed parameters of the User interface are getId and getName, and in the B module, the exposed parameters of the User interface are getId and the getName is empty. The annotation information of the same interface is not the same, and an error will be reported.
[0084] In the above embodiments, by setting the standardized interface annotation information and verifying the interface annotation information, an error can be reported in the compilation phase of the program, which can discover the program problems in advance, and avoid errors in the running phase, for example, the user downloads the app and finds that the installation fails. The present case can improve the detection efficiency of the program and improve the user experience.
[0085] In an embodiment, the generating of the interface proxy class of the respective modules based on the interface information table comprises:
[0086] Based on the interface annotation information in the interface information table, the corresponding interface annotation information is added to the declaration of the target interface of the interface proxy class;
[0087] Based on the method name of the target interface in the interface information table and the corresponding interface path information, the interface proxy class of the respective modules is generated.
[0088] Specifically, the interface annotation information is extracted from the target code text, and the interface proxy class contains the global interface, and the interface annotation information is added to the declaration of the target interface. Referring to the interface proxy class in the above example: static getService <t>(interfaceName: IService): T {。 Wherein T represents the interface type in the interface annotation information. By explicitly declaring the interface type, the compiler verifies whether the calling code conforms to the interface definition, completely eliminating runtime type errors.
[0089] In an example embodiment, the interface information table further includes the method name of the target interface, for example, in the abstract syntax tree, the key structural unit can include the function name, the parameter, etc., for example, in the following abstract syntax tree, the function name is: circleArea, and the parameter is: radius. The abstract syntax tree example is as follows:
[0090] SourceFile (the entire file)
[0091] └─ FunctionDeclaration (function declaration)
[0092] ├─ Identifier (function name: "circleArea")
[0093] ├─ Parameter (parameter)
[0094] │ ├─ Identifier (parameter name: "radius")
[0095] │ └─ NumberKeyword (type annotation: number)
[0096] ├─ NumberKeyword (return value type: number)
[0097] └─ Block (function body)
[0098] ├─ VariableDeclaration (variable declaration)
[0099] Since the specific implementation of the function method is not required in the interface, the method name of the target interface needs to be added in the management class.
[0100] In the above embodiment, by explicitly declaring the interface type, the compiler verifies whether the calling code conforms to the interface definition, completely eliminating runtime type errors. And based on the method name proposed in the abstract syntax tree and the corresponding interface path information, the interface proxy class of each module can be automatically generated.
[0101] In an example embodiment, the interface annotation information further includes the interface type, and after the interface proxy class of each module is generated based on the interface information table, the method further includes:
[0102] In a case where a data processing request of an account is received, version information corresponding to the account is acquired;
[0103] Based on a target calling instruction, the interface proxy class is called to instruct the interface proxy class to call a matched module interface based on the version information corresponding to the account; wherein the target calling instruction explicitly declares an interface type.
[0104] The data processing request can include a data acquisition request, a data modification request, a data deletion request, etc.
[0105] Specifically, the data processing request of the account can contain identification information of the account, and the account is shunted based on the identification information of the account, and the account is sorted into a user group A or a user group B, wherein the user group A is set to version 1.0, and the user group B is set to version 2.0.
[0106] In an exemplary embodiment, it is assumed that the account user1 is allocated to the user A group, and the data request of the account user1 is a data acquisition request, and there are two interfaces in the interface proxy class, interface 1 is based on the data acquisition of version 1.0; and interface 2 is based on the data acquisition of version 2.0. At this time, the management class calls interface 1 to implement the above-mentioned data acquisition.
[0107] In the above embodiment, the interface proxy class automatically calls the matched module interface based on the version information corresponding to the account, the influence of version update on global code is extremely low, and the flexibility and update efficiency of version update are improved. Further, the modules only communicate through the proxy class, the actual business code is zero direct dependence, and the calling party does not need to perceive the module ownership and internal logic of the interface implementation party, thereby reducing the coupling between the modules.
[0108] In one embodiment, after the interface information table is obtained by parsing and extracting the interface annotation information and the interface path information corresponding to each module in the target code text, the method further includes:
[0109] Converting the interface information table into a dynamic configuration table;
[0110] The calling of the matched module interface by the interface proxy class based on the version information corresponding to the account includes:
[0111] The calling of the matched module interface by the interface proxy class based on the version information corresponding to the account and the dynamic configuration table.
[0112] Specifically, the interface information table can be in JSON format, and the dynamic configuration table can be in JS format. The JSON file is converted into a lightweight JS dynamic configuration table through a key-value mapping conversion algorithm, a mapping relationship between a module identifier (Key) and an initialization parameter (Value) is established, and the application resource directory is embedded.
[0113] The dynamic configuration table contains the association relationship between the interface and the version. Therefore, the interface proxy class calls the module interface matched with the account version based on the version information corresponding to the account and the dynamic configuration table.
[0114] In a specific implementation process, as shown in Figure 3 The data processing method provided by the application includes the following steps: in a compilation and construction phase, a target code text is generated. An hvigor plug-in is registered, wherein the hvigor plug-in is a construction tool of a Hongmeng application of the Hongmeng, some plug-ins and extended capabilities can be added during compilation, the product code is modified again, and some codes are automatically generated. An AST analysis module source code is parsed. The method includes the following steps: S201, the target code text is split to obtain each structural unit. S203, based on the standard syntax rule corresponding to the code language of the target code text, a key structural unit is determined from each structural unit, and a syntax tree is determined based on the key structural unit and the dependency relationship of the key structural unit; wherein the key structural unit includes an interface. S205, based on the syntax tree, interface annotation information and interface path information corresponding to each module are identified; wherein the interface annotation information corresponds to a standard annotation identifier, and the annotation identifier is set at the interface declaration position of the corresponding interface. In a detection of annotation conflict phase, the interface annotation information corresponding to each module is detected based on a business specification; in the case that the interface annotation information of the same interface corresponding to at least two modules is different, a compilation error prompt is displayed. An interface information table JSON is generated, and the interface annotation information and the interface path information corresponding to each module in the target code text are parsed and extracted to obtain an interface information table. An interface proxy class is generated, and the interface information table is embedded in an application resource directory. In an application running phase, a dynamic configuration table is loaded, a routing engine is initialized, and an interface of a corresponding version is dynamically called according to an account identifier.
[0115] It should be understood that although the steps in the flowcharts involved in the embodiments described above are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.
[0116] Based on the same inventive concept, the embodiments of the present application also provide a data processing apparatus for implementing the above-mentioned data processing method. The implementation scheme for solving the problem provided by the apparatus is similar to the implementation scheme described in the above method, so the specific limitations in one or more data processing apparatus embodiments provided below can refer to the limitations of the data processing method described above, which will not be repeated here.
[0117] In one embodiment, as shown in Figure 4 a data processing apparatus is provided, comprising:
[0118] The acquisition module 401 is configured to acquire target code text, parse and extract interface annotation information and interface path information corresponding to each module in the target code text, and obtain an interface information table. The interface annotation information at least includes version information.
[0119] The generation module 403 is configured to generate an interface proxy class of each module based on the interface information table. The interface proxy class is configured to call a module interface corresponding to a version of an account when receiving a data processing request of the account.
[0120] In one embodiment, the acquisition module is further configured to:
[0121] Split the target code text to obtain each structural unit;
[0122] Determine a key structural unit from each structural unit based on a standard syntax rule corresponding to a code language of the target code text, and determine a syntax tree based on the key structural unit and a dependency relationship of the key structural unit. The key structural unit includes an interface.
[0123] Based on the syntax tree, interface annotation information and interface path information corresponding to each module are identified respectively; the interface annotation information corresponds to a standard annotation identifier, and the annotation identifier is set at the interface declaration of the corresponding interface.
[0124] In one of the embodiments, the obtaining module is further configured to:
[0125] Based on the business specification, the interface annotation information corresponding to each module is detected respectively;
[0126] In the case where the interface annotation information of the same interface corresponding to at least two modules is not the same, a compilation error prompt is displayed.
[0127] In one of the embodiments, the obtaining module is further configured to:
[0128] Based on the interface annotation information in the interface information table, corresponding interface annotation information is added at the declaration of the target interface of the interface proxy class;
[0129] Based on the method name of the target interface in the interface information table and the corresponding interface path information, the interface proxy class of each module is generated.
[0130] In one of the embodiments, the apparatus further includes a calling module,
[0131] The calling module is configured to, in the case where a data processing request of an account is received, obtain version information corresponding to the account;
[0132] Based on a target calling instruction, the interface proxy class is called to instruct the interface proxy class to call a matched module interface based on the version information corresponding to the account; the target calling instruction explicitly declares an interface type.
[0133] In one of the embodiments, the calling module is further configured to:
[0134] The interface information table is converted into a dynamic configuration table;
[0135] The interface proxy class is instructed to call a matched module interface based on the version information corresponding to the account and the dynamic configuration table.
[0136] Each module in the above data processing apparatus can be realized by software, hardware and a combination thereof in whole or in part. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform the operations of each module.
[0137] In one embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as follows: Figure 5 As shown in the figure, the computer device includes a processor, a memory, an input / output interface, and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store data processing data. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement a data processing method.
[0138] In one embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in the figure. Figure 6 As shown in the figure, the computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication), or other technologies. The computer program is executed by the processor to implement a data processing method. The display unit of the computer device is configured to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or can be a key, a trackball, or a touchpad arranged on the shell of the computer device, or can be an external keyboard, a touchpad, a mouse, or the like.
[0139] Those skilled in the art can understand that, Figure 6 It should be noted that the structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0140] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0141] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, database or other medium used in the embodiments provided by the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, etc., without being limited thereto.
[0142] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, as long as the combinations of technical features do not have contradictions, they shall be considered within the scope of the present disclosure.
[0143] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it shall not be understood as a limitation on the patent scope of the present application. It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present application, and these shall be within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.< / t> < / t>
Claims
1. A data processing method, characterized by, The method comprises: acquiring target code text, parsing and extracting interface annotation information and interface path information corresponding to each module in the target code text to obtain an interface information table; wherein the interface annotation information at least comprises version information; based on the interface information table, generating an interface proxy class of the modules; wherein the interface proxy class is used to call a module interface corresponding to a version of an account when receiving a data processing request of the account.
2. The method of claim 1, wherein, The parsing and extracting of the interface annotation information and the interface path information corresponding to each module in the target code text comprises: splitting the target code text to obtain each structural unit; based on the standard syntax rules corresponding to the code language of the target code text, determining a key structural unit from the structural units, and based on the key structural unit and the dependency relationship of the key structural unit, determining a syntax tree; wherein the key structural unit comprises an interface; based on the syntax tree, identifying the interface annotation information and the interface path information of the interfaces corresponding to each module; wherein the interface annotation information corresponds to a standard annotation identifier, and the annotation identifier is set at the interface declaration of the corresponding interface.
3. The method of claim 2, wherein, The interface annotation information further comprises an interface type and a parameter type, and after the identification of the interface annotation information and the interface path information of the interfaces corresponding to each module, the following steps are further included: based on the business specification, detecting the interface annotation information corresponding to each module; in the case that the interface annotation information of the same interface corresponding to at least two modules is not the same, displaying a compilation error prompt.
4. The method of claim 1, wherein, The generating of the interface proxy class of the modules based on the interface information table comprises: based on the interface annotation information in the interface information table, adding corresponding interface annotation information at the declaration of a target interface of the interface proxy class; based on the method name of the target interface in the interface information table and the corresponding interface path information, generating the interface proxy class of the modules.
5. The method of claim 1, wherein, The interface annotation information further comprises an interface type, and after the generating of the interface proxy class of the modules based on the interface information table, the following steps are further included: in the case that a data processing request of an account is received, acquiring version information corresponding to the account; based on a target calling instruction, calling the interface proxy class to instruct the interface proxy class to call a matched module interface based on the version information corresponding to the account; wherein the target calling instruction explicitly declares an interface type.
6. The method of claim 5, wherein, After the parsing and extracting of the interface annotation information and the interface path information corresponding to each module in the target code text to obtain the interface information table, the following steps are further included: converting the interface information table into a dynamic configuration table; The calling of the matched module interface by the interface proxy class based on the version information corresponding to the account comprises: the calling of the matched module interface by the interface proxy class based on the version information corresponding to the account and the dynamic configuration table.
7. A data processing apparatus, characterized by, The device comprises: An acquisition module is configured to acquire target code texts, parse and extract interface annotation information and interface path information corresponding to each module in the target code texts, and obtain an interface information table; the interface annotation information at least includes version information; A generation module is configured to generate interface proxy classes of the modules based on the interface information table; the interface proxy classes are configured to invoke module interfaces corresponding to a version of an account when receiving a data processing request of the account.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.