A consumer-end generation method, device, computer equipment, and storage medium

By analyzing and modifying the abstract syntax tree of generator and consumer interface information, and using the interface analyzer to generate consistent consumer code, the problem of low RPC consumer efficiency in microservices is solved, and rapid deployment and efficient maintenance are achieved.

CN112416631BActive Publication Date: 2024-09-13GUANGZHOU YIZHI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011459449.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-11
Publication Date
2024-09-13
Estimated Expiration
2040-12-11

AI Technical Summary

Technical Problem

The efficiency of the RPC consumer side in the microservices process of the existing SaaS platform is low, resulting in reduced maintainability and scalability, and increased deployment difficulty.

Method used

By obtaining and analyzing the generator and consumer interface information, the corresponding abstract syntax tree information is generated, and the preset interface analyzer is used to process the syntax tree to generate consumer code that is consistent with the consumer interface, and quickly build the RPC consumer end. , improve deployment efficiency and upgrade speed.

Benefits of technology

It realizes the rapid generation of RPC consumers, simplifies the deployment process, improves the deployment efficiency and maintainability of RPC clients, and reduces the difficulty of deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112416631B
    Figure CN112416631B
Patent Text Reader

Abstract

The present invention relates to the technical field of computer technology, and in particular to a consumer-side generation method, device, computer equipment and storage medium. The consumer-side generation method includes: obtaining and analyzing generator interface information and consumer interface information to obtain corresponding generator abstract syntax tree information and consumer abstract syntax tree information; modifying the generator abstract syntax tree information according to the consumer syntax tree information to obtain a consumer-side syntax tree consistent with the consumer-side code syntax tree; when a consumer service creation message is obtained, obtaining a corresponding consumer project framework; according to the consumer project framework, using a preset interface analyzer to process the consumer-side syntax tree to obtain corresponding consumer code data. The present application has the effect of quickly forming an RPC consumer end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer technology, and in particular to a consumer-side generation method, device, computer equipment and storage medium. Background Art

[0002] At present, SaaS (Software-as-a-Service) provides software services through the Internet. SaaS platform suppliers deploy application software on their own servers. Customers can order the required application software services from manufacturers through the Internet according to actual work needs, pay manufacturers according to the amount of ordered services and duration, and obtain services provided by SaaS platform suppliers through the Internet.

[0003] The application scope of existing SaaS is becoming more and more extensive. With the increasingly fierce competition in the SaaS industry, the business complexity of SaaS vendors is becoming higher and higher, the maintainability and scalability of single projects are gradually declining, and distributed microservices have become a trend in technological transformation. In the process of microservices, each service technology stack can form a high-cohesion and low-coupling service architecture, and each service can independently adopt a suitable technology stack.

[0004] With respect to the above-mentioned related technologies, the inventors believe that there is a defect of low efficiency in forming the RPC consumer end through microservices. Summary of the invention

[0005] The purpose of this application is to provide a consumer-end generation method, device, computer equipment and storage medium for quickly forming an RPC consumer-end.

[0006] The above-mentioned invention objective of the present application is achieved through the following technical solutions:

[0007] A consumer-end generation method, the consumer-end generation method comprising:

[0008] Obtain and analyze the generator interface information and the consumer interface information to obtain the corresponding generator abstract syntax tree information and the consumer abstract syntax tree information;

[0009] Modify the generator abstract syntax tree information according to the consumer syntax tree information to obtain a consumer-side syntax tree that is consistent with the consumer-side code syntax tree;

[0010] When the consumer service creation message is obtained, the corresponding consumer project framework is obtained;

[0011] According to the consumption project framework, the consumption-end syntax tree is processed using a preset interface analyzer to obtain corresponding consumer code data.

[0012] By adopting the above technical solution, by pre-acquiring and analyzing the generator interface information and the consumer interface information, and then obtaining the corresponding syntax tree information, it is possible to utilize the structural similarity of the syntax tree information corresponding to the generator interface information and the consumer interface information, so that the generator abstract syntax tree information can be modified to be the same as or related to the consumer syntax tree information, so as to facilitate rapid application when building a user end for consumers to use; when obtaining the consumer service creation message, by obtaining the corresponding consumer project framework, and using the preset interface analyzer and the modified consumer-end syntax tree, the corresponding code data can be quickly obtained, thereby improving the speed of building the RPC consumer end, and also improving the efficiency of RPC consumer end upgrade and deployment.

[0013] In a preferred example, the present application may be further configured as follows: before the consumer-side syntax tree is processed using a preset interface analyzer according to the consumer project framework to obtain corresponding consumer code data, the consumer-side generation method further includes:

[0014] Obtaining underlying RPC service data, and obtaining request protocol data and request response processing data from the underlying RPC service data;

[0015] The request protocol data and the request response processing data are encapsulated respectively to obtain the interface analyzer.

[0016] By adopting the above technical solution, by obtaining request protocol data and request response data from RPC service data and encapsulating them respectively, a unified interface analyzer corresponding to the RPC client can be obtained, thereby improving the efficiency of deploying the RPC client and simplifying the difficulty of deployment.

[0017] In a preferred example, the present application can be further configured as follows: according to the consumption project framework, the consumer-side syntax tree is processed using a preset interface analyzer to obtain corresponding consumer code data, specifically including:

[0018] Compare each of the consumption item frameworks to obtain corresponding framework difference data;

[0019] After encapsulating the framework difference data, a framework difference encapsulation package corresponding to each of the framework difference data is obtained;

[0020] The interface analyzer is used to process each of the framework difference encapsulation packages to obtain the consumer code data.

[0021] By adopting the above technical solution, by obtaining the framework difference data and sealing the framework difference data, when creating multiple RPC clients, by obtaining the corresponding framework difference data, different consumption framework data can be used to uniformly generate RPC clients.

[0022] In a preferred example, the present application may be further configured as follows: the acquiring and analyzing of the producer interface information and the consumer interface information to obtain the corresponding producer abstract syntax tree information and the consumer abstract syntax tree information specifically includes:

[0023] Acquire corresponding Interface data from the generator interface information and the consumer interface information;

[0024] The generator abstract syntax tree information and the consumer abstract syntax tree information are respectively obtained from the Interface data of the generator interface information and the consumer interface information, wherein the generator abstract syntax tree information and the consumer abstract syntax tree information both include interface naming information, interface namespace information and interface method declaration information.

[0025] By adopting the above technical solution and obtaining Interface data, the characteristics of Interface can be utilized to implement the same interface for both the generator and the consumer of the service, which can help improve the efficiency of obtaining syntax tree information, thereby improving the efficiency of deploying RPC client code.

[0026] In a preferred example, the present application may be further configured as follows: when a consumer service creation message is obtained, a corresponding consumer item framework is obtained, specifically including:

[0027] Acquire consumption scenario demand information from the consumption service creation message;

[0028] The corresponding consumption item framework is matched according to the consumption scenario demand information.

[0029] By adopting the above technical solution, by obtaining consumption scenario demand information, the corresponding consumption project framework can be matched, thereby improving the intelligence of obtaining the consumption project framework, and further improving the efficiency of deploying the RPC client.

[0030] The second object of the invention is achieved by the following technical solutions:

[0031] A consumer-end generating device, the consumer-end generating device comprising:

[0032] The interface acquisition module is used to acquire and analyze the producer interface information and the consumer interface information to obtain the corresponding producer abstract syntax tree information and the consumer abstract syntax tree information;

[0033] An interface debugging module, used to modify the generator abstract syntax tree information according to the consumer syntax tree information to obtain a consumer-side syntax tree consistent with the consumer-side code syntax tree;

[0034] The framework acquisition module is used to obtain the corresponding consumption project framework when the consumption service creation message is obtained;

[0035] The client deployment module is used to process the consumer-side syntax tree using a preset interface analyzer according to the consumer project framework to obtain corresponding consumer code data.

[0036] By adopting the above technical solution, by pre-acquiring and analyzing the generator interface information and the consumer interface information, and then obtaining the corresponding syntax tree information, it is possible to utilize the structural similarity of the syntax tree information corresponding to the generator interface information and the consumer interface information, so that the generator abstract syntax tree information can be modified to be the same as or related to the consumer syntax tree information, so as to facilitate rapid application when building a user end for consumers to use; when obtaining the consumer service creation message, by obtaining the corresponding consumer project framework, and using the preset interface analyzer and the modified consumer-end syntax tree, the corresponding code data can be quickly obtained, thereby improving the speed of building the RPC consumer end, and also improving the efficiency of RPC consumer end upgrade and deployment.

[0037] The third objective of the present application is achieved through the following technical solutions:

[0038] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned consumer-end generation method when executing the computer program.

[0039] The fourth objective of the present application is achieved through the following technical solutions:

[0040] A computer-readable storage medium stores a computer program, which implements the steps of the above-mentioned consumer-end generation method when executed by a processor.

[0041] In summary, the present application includes at least one of the following beneficial technical effects:

[0042] 1. When obtaining the consumer service creation message, by obtaining the corresponding consumer project framework, and using the preset interface analyzer and the modified consumer-side syntax tree, the corresponding code data can be quickly obtained, thereby improving the speed of building the RPC consumer side, and also improving the efficiency of RPC consumer side upgrade and deployment;

[0043] 2. By obtaining the request protocol data and request response data from the RPC service data and encapsulating them respectively, a unified interface analyzer corresponding to the RPC client can be obtained, thereby improving the efficiency of deploying the RPC client and simplifying the difficulty of deployment;

[0044] 3. By obtaining the Interface data, the characteristics of the Interface can be used to implement the same interface for both the service generator and the consumer, which can help improve the efficiency of obtaining syntax tree information, thereby improving the efficiency of deploying the RPC client code;

[0045] 4. By obtaining the framework difference data and sealing the framework difference data, when creating multiple RPC clients, by obtaining the corresponding framework difference data, different consumption framework data can be used to uniformly generate RPC clients. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a flow chart of a consumer-side generation method in an embodiment of the present application;

[0047] Figure 2 This is another implementation flow chart of the consumer-side generation method in one embodiment of the present application;

[0048] Figure 3 It is a flowchart for implementing step S40 in the consumer-side generation method in one embodiment of the present application;

[0049] Figure 4 It is a flowchart for implementing step S20 in the consumer-side generation method in one embodiment of the present application;

[0050] Figure 5 It is a flowchart for implementing step S30 in the consumer-side generation method in one embodiment of the present application;

[0051] Figure 6 This is a principle block diagram of a consumer-side generating device in one embodiment of the present application;

[0052] Figure 7 It is a schematic diagram of a device in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The present application is further described in detail below in conjunction with the accompanying drawings.

[0054] In one embodiment, if Figure 1 As shown, the present application discloses a consumer-side generation method, which specifically includes the following steps:

[0055] S10: Acquire and analyze the producer interface information and the consumer interface information to obtain corresponding producer abstract syntax tree information and consumer abstract syntax tree information.

[0056] In this embodiment, the generator interface information refers to the interface of the background underlying server language. The consumer interface information refers to the interface of the consumer-oriented client programming language. The generator abstract syntax tree information refers to the structure used to represent the server source code. The consumer abstract syntax tree information refers to the structure used to identify the source code of the consumer-oriented client.

[0057] Specifically, when connecting various microservices quickly and effectively, RPC technology (Remote Procedure Call) plays a key role, but the inventors found that when writing the corresponding RPC consumer code according to the RPC service, the cost is too high and it is easy to make mistakes. Among them, the generator interface information and consumer interface information of the response are obtained, and according to the language environment of the specific editing code, the generator interface information and consumer interface information are analyzed using the corresponding tools to obtain the generator abstract syntax tree information and consumer abstract syntax tree information.

[0058] S20: Modify the generator abstract syntax tree information according to the consumer syntax tree information to obtain a consumer-side syntax tree that is consistent with the consumer-side code syntax tree.

[0059] Specifically, since the structures of the contents of the consumer syntax tree information and the generator abstract syntax tree information are similar, the contents of the generator abstract syntax tree are modified according to the contents of the consumer syntax tree information obtained through the generator interface information and the consumer interface information, so that the contents of the generator abstract syntax tree are consistent with the consumer syntax tree information.

[0060] S30: When the consumer service creation message is obtained, the corresponding consumer item framework is obtained.

[0061] In this embodiment, the consumption service creation message refers to a message used to create a user terminal code for use by the consumer. The consumption project framework refers to the type of user terminal content that needs to be created.

[0062] Specifically, when it is necessary to create a corresponding user terminal for consumer users, a corresponding consumption project framework is formed according to the specific needs of the user terminal. For example, for an e-commerce mall, it can be the specific types of goods sold and the business logic of the merchant when selling goods.

[0063] Furthermore, after the consumption project framework is obtained, the consumption service is triggered to create a message.

[0064] S40: According to the consumption project framework, a preset interface analyzer is used to process the consumption-side syntax tree to obtain corresponding consumer code data.

[0065] In this embodiment, the interface analyzer refers to a model used to adjust the interface between the user end and the server end and obtain the corresponding consumer code data.

[0066] Specifically, according to the consumer project framework, the functions that need to be implemented by the specific user end to be built are obtained, and through the interface analyzer, the code data corresponding to each function is obtained from the interface of the server side and written into the consumer project framework, thereby obtaining the consumer code data.

[0067] In this embodiment, by pre-acquiring and analyzing the generator interface information and the consumer interface information, and then obtaining the corresponding syntax tree information, the similarity of the structure of the syntax tree information corresponding to the generator interface information and the consumer interface information can be used to modify the generator abstract syntax tree information to be the same as or related to the consumer syntax tree information, so as to facilitate rapid application when building a user end for consumers to use; when the consumer service creation message is obtained, the corresponding consumer project framework is obtained, and the preset interface analyzer and the modified consumer-end syntax tree are used to quickly obtain the corresponding code data, thereby improving the speed of building the RPC consumer end, and also improving the efficiency of RPC consumer end upgrade and deployment.

[0068] Furthermore, if Figure 2 As shown, before step S40, that is, before using a preset interface analyzer to process the consumer-side syntax tree to obtain corresponding consumer code data, the consumer-side generation method further includes:

[0069] S401: Obtain underlying RPC service data, and obtain request protocol data and request response processing data from the underlying RPC service data.

[0070] In this embodiment, the underlying RPC service data refers to the underlying code data on the server side, which is used to implement the server side function code data.

[0071] Specifically, in the underlying code data of the server, request data for obtaining the system protocol and request response processing data for responding to each request are obtained. Optionally, in this embodiment, data for processing errors that may occur in each protocol request and request response processing can also be obtained from the underlying RPC service data.

[0072] S402: Encapsulate the request protocol data and the request response processing data respectively to obtain an interface analyzer.

[0073] Specifically, the request protocol data and request response data of each server function are respectively packaged to obtain the interface analyzer.

[0074] Furthermore, if Figure 3 As shown, in step S40, the consumer-side syntax tree is processed using a preset interface analyzer according to the consumer project framework to obtain corresponding consumer code data, specifically including:

[0075] S41: Compare each consumption item framework to obtain corresponding framework difference data.

[0076] In this embodiment, the frame difference data refers to the data of the difference between each consumption item frame.

[0077] Specifically, if more than one consumption item framework is obtained, each consumption item framework is compared in pairs to obtain the framework difference data between each consumption item framework and other consumption item frameworks, that is, the data corresponding to the unique functions of each independent user terminal.

[0078] S42: After encapsulating the framework difference data, a framework difference encapsulation package corresponding to each framework difference data is obtained.

[0079] Specifically, after marking each consumption item framework with a unique character or string, the framework difference data corresponding to each consumption item framework is encapsulated, and the mark is used for mark association, so as to obtain a framework difference encapsulation package corresponding to each framework difference data.

[0080] S43: Packaging packages according to each framework difference is processed using an interface analyzer to obtain consumer code data.

[0081] Specifically, an interface analyzer is used to obtain the same portion of code data in each consumer framework data from the underlying RPC service data of the server, and write the code data into a corresponding position in each consumer framework data.

[0082] Furthermore, according to each framework difference encapsulation package, the interface analyzer is used to obtain the code data corresponding to each framework difference encapsulation package, and according to the mark of each framework difference encapsulation package, the consumer project framework to which each framework difference encapsulation package belongs is obtained, and the code data corresponding to each framework encapsulation package is written into the corresponding consumer project framework, thereby obtaining each consumer code data.

[0083] Furthermore, if Figure 4 As shown, in step S20, the producer interface information and the consumer interface information are obtained and analyzed to obtain the corresponding producer abstract syntax tree information and the consumer abstract syntax tree information, which specifically include:

[0084] S21: Obtain corresponding Interface data from the producer interface information and the consumer interface information.

[0085] In this embodiment, the Interface data refers to the interface data corresponding to the producer interface information and the consumer interface information.

[0086] Specifically, in this embodiment, the Interface information of the generator interface information and the consumer interface information is analyzed by the "nikic / php-parser" tool.

[0087] S22: Obtaining the generator abstract syntax tree information and the consumer abstract syntax tree information from the Interface data of the generator interface information and the consumer interface information respectively, wherein the generator abstract syntax tree information and the consumer abstract syntax tree information both include interface naming information, interface namespace information and interface method declaration information.

[0088] Specifically, after obtaining the Interface data corresponding to the producer interface information and the consumer interface information, the data types in the Interface data are extracted respectively, thereby obtaining the interface naming information, the interface namespace information and the interface method declaration information.

[0089] Furthermore, if Figure 5 As shown, in step S30, when the consumer service creation message is obtained, the corresponding consumer project framework is obtained, which specifically includes:

[0090] S31: Obtain consumption scenario requirement information from the consumption service creation message.

[0091] In this embodiment, the consumption scenario demand information refers to the data of the application scenario used by each user terminal, and may also be the information of the scenario corresponding to each functional module in the dedicated user terminal.

[0092] Specifically, when constructing a user terminal, the consumption scenario demand information is obtained from data recording the application requirements of the user terminal.

[0093] S32: Match the corresponding consumption project framework according to the consumption scenario demand information.

[0094] Specifically, the functions that need to be built in the user end are obtained from the consumption scenario demand information, and the consumption project framework is built through the functions.

[0095] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0096] In one embodiment, a consumer-end generation device is provided, which corresponds one-to-one to the consumer-end generation method in the above embodiment. Figure 6 As shown, the consumer-end generation device includes an interface acquisition module, an interface debugging module, a framework acquisition module and a client deployment module. The detailed description of each functional module is as follows:

[0097] The interface acquisition module is used to acquire and analyze the producer interface information and the consumer interface information to obtain the corresponding producer abstract syntax tree information and the consumer abstract syntax tree information;

[0098] The interface debugging module is used to modify the generator abstract syntax tree information according to the consumer syntax tree information to obtain a consumer-side syntax tree that is consistent with the consumer-side code syntax tree;

[0099] The framework acquisition module is used to obtain the corresponding consumption project framework when the consumption service creation message is obtained;

[0100] The client deployment module is used to process the consumer-side syntax tree using a preset interface analyzer according to the consumer project framework to obtain the corresponding consumer code data.

[0101] Optionally, the consumer-side generating device further includes:

[0102] The underlying data acquisition module is used to obtain the underlying RPC service data, and obtain the request protocol data and the request response processing data from the underlying RPC service data;

[0103] The encapsulation module is used to encapsulate the request protocol data and the request response processing data respectively to obtain an interface analyzer.

[0104] Optionally, the client deployment module includes:

[0105] The difference comparison submodule is used to compare each consumption item framework to obtain the corresponding framework difference data;

[0106] The data encapsulation submodule is used to encapsulate the frame difference data to obtain a frame difference encapsulation package corresponding to each frame difference data;

[0107] The deployment submodule is used to package the package according to each framework difference, and process it using the interface analyzer to obtain the consumer code data.

[0108] Optionally, the interface debugging module includes:

[0109] The interface data acquisition submodule is used to obtain the corresponding Interface data from the producer interface information and the consumer interface information;

[0110] The interface information acquisition submodule is used to obtain the generator abstract syntax tree information and the consumer abstract syntax tree information from the Interface data of the generator interface information and the consumer interface information respectively, wherein the generator abstract syntax tree information and the consumer abstract syntax tree information both include interface naming information, interface namespace information and interface method declaration information.

[0111] Optionally, the framework acquisition module includes:

[0112] The scenario acquisition submodule is used to obtain consumption scenario requirement information from the consumption service creation message;

[0113] The framework matching submodule is used to match the corresponding consumption project framework according to the consumption scenario demand information.

[0114] For the specific definition of the consumer-side generation device, please refer to the definition of the consumer-side generation method above, which will not be repeated here. Each module in the above-mentioned consumer-side generation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0115] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used 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 the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store an interface analyzer. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a consumer-end generation method is implemented.

[0116] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0117] Obtain and analyze the generator interface information and the consumer interface information to obtain the corresponding generator abstract syntax tree information and the consumer abstract syntax tree information;

[0118] Modify the generator abstract syntax tree information according to the consumer syntax tree information to obtain a consumer-side syntax tree that is consistent with the consumer-side code syntax tree;

[0119] When the consumer service creation message is obtained, the corresponding consumer project framework is obtained;

[0120] According to the consumer project framework, the consumer-side syntax tree is processed using the preset interface analyzer to obtain the corresponding consumer code data.

[0121] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0122] Obtain and analyze the generator interface information and the consumer interface information to obtain the corresponding generator abstract syntax tree information and the consumer abstract syntax tree information;

[0123] Modify the generator abstract syntax tree information according to the consumer syntax tree information to obtain a consumer-side syntax tree that is consistent with the consumer-side code syntax tree;

[0124] When the consumer service creation message is obtained, the corresponding consumer project framework is obtained;

[0125] According to the consumer project framework, the consumer-side syntax tree is processed using the preset interface analyzer to obtain the corresponding consumer code data.

[0126] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and 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 embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0127] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0128] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A consumer-side generation method, It is characterized in that The consumer-side generation method comprises: Obtain and analyze the generator interface information and the consumer interface information to obtain the corresponding generator abstract syntax tree information and the consumer abstract syntax tree information; Modify the generator abstract syntax tree information according to the consumer syntax tree information to obtain a consumer-side syntax tree that is consistent with the consumer-side code syntax tree; When the consumer service creation message is obtained, the corresponding consumer project framework is obtained; Obtaining underlying RPC service data, and obtaining request protocol data and request response processing data from the underlying RPC service data; Encapsulating the request protocol data and the request response processing data respectively to obtain the interface analyzer; According to the consumer project framework, the consumer-side syntax tree is processed using a preset interface analyzer to obtain corresponding consumer code data, specifically including: Compare each of the consumption item frameworks to obtain corresponding framework difference data; After encapsulating the framework difference data, a framework difference encapsulation package corresponding to each of the framework difference data is obtained; The interface analyzer is used to process each of the framework difference encapsulation packages to obtain the consumer code data.

2. The consumer-side generation method according to claim 1, It is characterized in that The acquiring and analyzing the producer interface information and the consumer interface information to obtain the corresponding producer abstract syntax tree information and the consumer abstract syntax tree information specifically includes: Acquire corresponding Interface data from the generator interface information and the consumer interface information; The generator abstract syntax tree information and the consumer abstract syntax tree information are respectively obtained from the Interface data of the generator interface information and the consumer interface information, wherein the generator abstract syntax tree information and the consumer abstract syntax tree information both include interface naming information, interface namespace information and interface method declaration information.

3. The consumer-side generation method according to claim 1, It is characterized in that When the consumer service creation message is obtained, the corresponding consumer project framework is obtained, specifically including: Acquire consumption scenario demand information from the consumption service creation message; The corresponding consumption item framework is matched according to the consumption scenario demand information.

4. A consumer-end generating device, It is characterized in that The consumer-end generating device comprises: The interface acquisition module is used to acquire and analyze the producer interface information and the consumer interface information to obtain the corresponding producer abstract syntax tree information and the consumer abstract syntax tree information; An interface debugging module, used to modify the generator abstract syntax tree information according to the consumer syntax tree information to obtain a consumer-side syntax tree consistent with the consumer-side code syntax tree; The framework acquisition module is used to obtain the corresponding consumption project framework when the consumption service creation message is obtained; An underlying data acquisition module, used to acquire underlying RPC service data, and acquire request protocol data and request response processing data from the underlying RPC service data; An encapsulation module, used to encapsulate the request protocol data and the request response processing data respectively to obtain the interface analyzer; The client deployment module is used to process the consumer-side syntax tree using a preset interface analyzer according to the consumer project framework to obtain corresponding consumer code data. The client deployment module includes: A difference comparison submodule is used to compare each of the consumption item frameworks to obtain corresponding framework difference data; A data encapsulation submodule, used for encapsulating the framework difference data to obtain a framework difference encapsulation package corresponding to each of the framework difference data; The deployment submodule is used to package the package according to each of the framework differences and process it using the interface analyzer to obtain the consumer code data.

5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the consumer-end generation method according to any one of claims 1 to 3 are implemented.

6. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the consumer-side generation method according to any one of claims 1 to 3 are implemented.