CN117555528A - Method, device, equipment and medium for generating service code frame - Google Patents

Method, device, equipment and medium for generating service code frame Download PDF

Info

Publication number
CN117555528A
CN117555528A CN202410046267.8A CN202410046267A CN117555528A CN 117555528 A CN117555528 A CN 117555528A CN 202410046267 A CN202410046267 A CN 202410046267A CN 117555528 A CN117555528 A CN 117555528A
Authority
CN
China
Prior art keywords
service
layer
code
frame
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410046267.8A
Other languages
Chinese (zh)
Other versions
CN117555528B (en
Inventor
张浩阳
肖睿
习力洋
温序铭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Sobei Video Cloud Computing Co ltd
Original Assignee
Chengdu Sobei Video Cloud Computing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Sobei Video Cloud Computing Co ltd filed Critical Chengdu Sobei Video Cloud Computing Co ltd
Priority to CN202410046267.8A priority Critical patent/CN117555528B/en
Publication of CN117555528A publication Critical patent/CN117555528A/en
Application granted granted Critical
Publication of CN117555528B publication Critical patent/CN117555528B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The utility model discloses a method, a device, equipment and a medium for generating a service code frame, which firstly designs a service frame code template based on the relation between a client and a server through a service frame design module, then generates the service code frame through the service frame generation module by using the service frame code template, a service code frame generation program written in Go language and JSON data, and the generated service code frame can efficiently construct a service system based on remote procedure call, thereby providing more interface realization modes to adapt to different situations and further improving development efficiency.

Description

Method, device, equipment and medium for generating service code frame
Technical Field
The application relates to the technical field of software engineering, in particular to a method and a device for generating a service code frame.
Background
There are various types of network protocols, such as transmission control protocol, hypertext transfer protocol, remote procedure call, etc., which all have different disadvantages, the transmission control protocol (Transmission Control Protocol, TCP) is a connection-oriented, reliable network transmission protocol that provides end-to-end data transmission services, ensuring that data can be sent and received correctly. However, the transmission control protocol provides only a reliable data transmission mechanism, and has no semantics for defining functions such as remote function call, parameter transfer, error processing, etc., and if the TCP is used to implement services and dependent functions, an additional protocol or framework is required to define and process these semantics, which may bring excessive development cost to developers.
Whereas the hypertext transfer protocol (Hypertext Transfer Protocol, HTTP) is an application layer protocol for transferring hypertext in a network, the client and server of the transfer control protocol may run on different machines, communicating via the internet. It provides a higher level of abstraction and functionality relative to the transmission control protocol, but it also lacks the semantics required to implement functions such as remote function call, parameter delivery, error handling, etc., and requires additional protocols or frameworks to supplement, and the hypertext transfer protocol itself is a clear text protocol, with data being transferred using text format, resulting in additional performance overhead.
Remote procedure call (Remote Procedure Call, RPC) is a computer communication protocol that allows the invocation of programs in different process spaces without requiring explicit writing of network code. Remote procedure calls well support the construction of distributed services, but IDL code files are often written when defining interfaces required for services in the remote procedure call frameworks currently popular on the market, which brings additional learning costs, and the core components of these remote procedure call frameworks are mostly developed by development teams through their own code libraries, which, while improving program performance, pose difficulties for users in deployment debugging and secondary development.
Therefore, how to solve the drawbacks of the above three network protocols becomes one of the directions of research by those skilled in the art.
Disclosure of Invention
The purpose of the application is to overcome the defects of the prior art, provide a method and a device for generating a service code frame, and the generated service code frame can efficiently construct a service system based on remote procedure call, provide more interface realization modes to adapt to different conditions, and further improve development efficiency.
The purpose of the application is realized through the following technical scheme:
in a first aspect, the present application proposes a method for generating a service code frame, the method being applied to a service code frame generating device, the device including a service frame design module and a service frame generating module, the method comprising:
designing a service framework code template based on the relation between the client and the server through a service framework design module;
the service frame is generated by the service frame generation module by using the service frame code template, the service code frame generation program written in the Go language and the JSON data.
In one possible implementation, the step of designing, by the service framework design module, a service framework code template based on a relationship between the client and the server includes:
selecting a shell layer of a client and a proxy layer, a svr layer and an impl layer of a server;
and packaging a plurality of services in the teller layer into a dependent layer, and combining a proxy layer, a svr layer and an repl layer of the service end to obtain the service framework code template.
In one possible implementation, the interface types of the serviced framework code templates are defined as a request response type, a publish-subscribe type, and an event notification type;
interface corresponding functions are written in the serviced frame code templates in the form of wild cards.
In one possible implementation, the request response type of the interface enables the user to call the synchronous interface or the asynchronous interface to realize synchronous or asynchronous request response function, wherein the synchronous interface returns to the user through the proxy layer after the server calls the implementation function, and the asynchronous interface returns to the user through the callback function and the proxy layer after the server calls the implementation function.
In one possible implementation, the type of the interface of the publish-subscribe type supports invoking a synchronous interface or an asynchronous interface to implement a synchronous or asynchronous publish-subscribe function, the publish-subscribe function is to send data to a user according to the publish-subscribe form, the synchronous interface invokes an imal layer to send a change event to a svr layer, the change event is synchronized to a teller layer through a proxy layer, the asynchronous interface invokes the imal layer to send the change event to a svr layer, and the change event is sent to a client asynchronously through the proxy layer.
In one possible implementation, the event notification type interface type sends the event to the subscriber in the form of a publish-subscribe, and the event notification type interface call mode is asynchronous call.
In one possible implementation, the step of generating, by the service framework generation module, the service framework using the service framework code template, the service code framework generation program written in Go language, and JSON data, includes:
s21, reading JSON data;
step S22, judging whether the JSON data is successfully read, if so, executing step S23, and if not, executing step S24;
step S23, creating a load folder path, and executing step S25;
step S24, throwing out JSON data, judging reading abnormality and ending the flow;
step S25, judging whether the load folder path is successfully created, if so, executing step S26, and if not, executing step S27;
step S26, traversing JSON data, and executing step S28;
step S27, judging that the created path is abnormal, throwing out the created path, and ending the flow;
step S28, judging whether the traversal is finished, if so, executing step S29, and if not, executing step S30;
step S29, the generation of the service code frame is successful;
step S30, analyzing the JSON data by using a server code frame generation program to obtain interface object data, and executing step S31;
step S31, judging whether the format of the interface object data is wrong, if yes, executing step S32, and if no, executing step S33;
step S32, judging that the data format is abnormal, throwing out the data format, and ending the flow;
and step S33, creating a corresponding file in a corresponding folder according to the wild card in the service framework code template by using the interface object data, writing a code, and returning to the step S28.
In a second aspect, the present application proposes a service code framework generating apparatus, the apparatus comprising a service framework design module and a service framework generating module;
the service framework design module is used for designing a service framework code template based on the relation between the client and the server;
and the service frame generation module is used for generating the service code frame by using the service frame code template, the service code frame generation program written in the Go language and the JSON data.
In a third aspect, the present application also proposes a computer device comprising a processor and a memory, the memory having stored therein a computer program, the computer program being loaded and executed by the processor to implement the method of generating a serviced code framework according to any of the first aspects.
In a fourth aspect, the present application also proposes a computer readable storage medium having stored therein a computer program, the computer program being loaded and executed by a processor to implement the method for generating a server code framework according to any one of the first aspects.
The main scheme and each further option of the application can be freely combined to form a plurality of schemes, which are all schemes that can be adopted and claimed by the application; and the selection(s) of non-conflicting choices and other choices may be freely combined. Numerous combinations will be apparent to those skilled in the art upon review of the present application, and are not intended to be exhaustive or to be construed as limiting the scope of the invention.
The beneficial effects of this application are:
compared with the existing transmission control protocol, the method for generating the service code frame has a higher-level abstract interface, so that a developer can call remote service like a local function, and the frame also shields bottom details of remote call, so that development efficiency is further improved.
Secondly, compared with the existing hypertext transfer protocol, the method for generating the service code framework uses a more efficient binary protocol for data transfer, which means that lower delay and higher throughput can be provided for the system, and meanwhile, the framework also provides more interface realization modes, and a developer can select a proper serialization mode, a load balancing strategy, a data compression algorithm and the like according to requirements and support advanced characteristics such as asynchronous calling, streaming data transfer and the like.
Thirdly, compared with the existing remote procedure call protocol (RPC framework), the method for generating the service code framework provides a more flexible design mode of the service framework, improves the design efficiency of the service system by using JSON as an interface design mode, reduces the threshold of development and maintenance under the condition that the data transmission performance is not excessively influenced by introducing QT framework content, simultaneously further separates the specific realization of a service interface and the method on the basis of shielding network communication details of a bottom layer, and improves the development efficiency.
Drawings
Fig. 1 shows a flowchart of a method for generating a service code frame according to an embodiment of the present application.
Fig. 2 shows a schematic structural diagram of a service framework code template according to an embodiment of the present application.
Fig. 3 shows a schematic diagram of a dependent encapsulation layer provided in an embodiment of the present application.
Fig. 4 shows a request response type interface architecture diagram according to an embodiment of the present application.
Fig. 5 shows a diagram of an interface type architecture of a publish-subscribe type according to an embodiment of the present application.
Fig. 6 shows an interface type architecture diagram of event notification type provided in an embodiment of the present application.
Fig. 7 is a schematic sub-flowchart of a method for generating a service code frame according to an embodiment of the present application.
Detailed Description
Other advantages and effects of the present application will become apparent to those skilled in the art from the present disclosure, when the following description of the embodiments is taken in conjunction with the accompanying drawings. The present application may be embodied or carried out in other specific embodiments, and the details of the present application may be modified or changed from various points of view and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict.
All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In the prior art, the transmission control protocol and the hypertext transmission protocol have the defect that the semantics of functions such as remote function call, parameter transfer, error processing and the like are not defined, and the remote procedure call has the defects of difficulty in deployment debugging and secondary development and the like.
Therefore, in order to solve the above-mentioned drawbacks of the three network protocols, the embodiments of the present application provide a method, an apparatus, a device, and a medium for generating a service code frame, where a specific implementation process of the obtained service code frame needs to be performed in combination with a universal UML activity diagram element and a remote procedure call protocol content, so that a service system based on remote procedure call can be efficiently constructed, and a transmission control protocol, a hypertext transfer protocol, and a universal remote procedure call service frame are integrated through a design mechanism.
Referring to fig. 1, fig. 1 shows a flowchart of a method for generating a service code frame according to an embodiment of the present application, where the method is applied to a service code frame generating device, and the device includes a service frame design module and a service frame generating module, and the method for generating a service code frame includes the following steps:
and S1, designing a service framework code template based on the relation between the client and the server through a service framework design module.
The service framework design module designs a C++ project template of a service system code framework based on QT/C++ according to the relation between a client and a server in a layering manner, wherein Qt is a cross-platform C++ graphic desktop application development framework, and a service calling function can be realized by using Qobject properties in the QT framework.
The step of designing a service framework code template based on the relationship between the client and the server by a service framework design module includes:
selecting a shell layer of a client and a proxy layer, a svr layer and an impl layer of a server;
and packaging a plurality of services in the teller layer into a dependent layer, and combining a proxy layer, a svr layer and an repl layer of the service end to obtain the service framework code template.
Referring to fig. 2, fig. 2 shows a schematic structural diagram of a service framework code template according to an embodiment of the present application, and first, the service framework code template is divided into a caller layer, a proxy layer, a svr layer, and an impl layer according to functions, where the caller layer is a client portion, and is used as an interface for calling a user service, and can request to call an application or other services. The proxy layer, the svr layer and the repl layer are service end parts, a plurality of services possibly occurring in the caller layer are additionally packaged into a dependent layer to form a service framework code template, wherein the svr layer provides an interface for packaging specific realization of the service end for a client to call, the repl layer is set as a specific realization part of the service end to provide specific realization of service call for a user, and the proxy layer uses QT/C++ codes to realize communication between the client and the service end.
The proxy layer, the svr layer and the repl layer all contain QT codes, the repl layer is C++ codes, the repl layer can be used for users to iterate by themselves, the users only need to pay attention to the realization of specific service codes of the repl layer, and do not need to pay attention to the realization logic of service call, so that the working efficiency of the users is improved.
Depending services in a plurality of clients often appear in a server system, the depending services are uniformly packaged into a dependent layer, the dependent layer and an impl layer are pure C++ codes which are used for quick call of users, based on FIG. 2, please refer to FIG. 3, FIG. 3 shows a schematic diagram of the dependent packaging layer provided by the embodiment of the application, B, C, D services in a shell layer are packaged in the dependent layer, and a server framework code template is formed by combining a proxy layer, a svr layer and an impl layer.
The interface type of the service framework code template is defined as a request response type, a publish-subscribe type and an event notification type;
interface corresponding functions are written in the serviced frame code templates in the form of wild cards.
After the service frame code template is constructed, the service frame code template can be used after interface type definition and programming of interface corresponding functions are needed, and wild cards of the Go language are added to the implementation content of each function in the service frame code template so that a generating program generates high-level characteristics required by a system according to the wild cards.
The request response type enables a user to call a synchronous interface or an asynchronous interface to realize synchronous or asynchronous request response function, wherein the synchronous interface returns to the user through a proxy layer after a server calls a realization function, and the asynchronous interface returns to the user through a callback function and the proxy layer after the server calls the realization function.
Fig. 4 shows a structure diagram of a request response type interface proposed in an embodiment of the present application, where the request response type interface is implemented using a concept of dependency. When the synchronous interface is called, the dependent layer calls a synchronous request response interface to the teller layer, the teller layer sends a request to the svr layer, the svr layer calls a specific implementation function to the repl layer, the repl layer returns the function to the svr layer, the svr layer sends a response to the teller layer, and the teller layer sends the response to the dependent layer. The asynchronous interface returns to the user through the proxy layer through the callback function provided by the user after the server calls the specific implementation function, the flow for calling the asynchronous interface is the same as the flow for calling the synchronous interface, but the asynchronous interface additionally comprises callback function parameters for exception handling, and the flow of the asynchronous interface is not described here.
The synchronous interface calls an image layer to send a change event to a svr layer, the change event is synchronous to a teller layer through a proxy layer, the asynchronous interface calls the image layer to send the change event to a svr layer, and the change event is asynchronously sent to a client through the proxy layer.
The essence of the publish-subscribe interface is that data is sent to a user in a publish-subscribe form, fig. 5 shows a structure diagram of a publish-subscribe interface type provided by the embodiment of the application, when a synchronous interface is called, a dependent layer calls a synchronous request response interface to a teller layer, the teller layer sends subscription to a svr layer, a svr layer calls a reading function to an repl layer, the repl layer returns a change event to a svr layer, the svr layer sends a notification event svr layer to the svr layer after writing the change to the repl layer, and the teller layer sends a response to the dependent layer.
The event notification type interface type sends an event to a subscriber in a release subscription mode, and the event notification type interface calling mode is asynchronous calling. Referring to fig. 6, fig. 6 shows an interface type architecture diagram of event notification provided in the embodiment of the present application, where a dependent layer calls an asynchronous event interface to a teller layer, the teller layer sends a subscription to a svr layer, a svr layer calls a read function to an repl layer, the repl layer returns a change event to a svr layer, a svr layer writes the change to the repl layer, the repl layer sends a notification event to a svr layer, the svr layer issues a response to the teller layer, and the teller layer sends a callback signal to the dependent layer.
The client calls the interface type of the event notification type to realize the binding of the event subscription service, when the server sends an event signal, the client calls a response event of the svr layer of the server, then calls a transmission event of the repl layer, and finally returns to the svr layer to asynchronously transmit the event to the client through the proxy layer. The callback function realized by the service end repl layer returns to the user by using the proxy layer, and when a plurality of services call the same event notification type interface type, only one callback function can be bound, so that the performance cost is reduced under the condition of ensuring normal data transmission.
And S2, generating a service code frame by using the service frame code template, a service code frame generation program written in the Go language and JSON data through a service frame generation module.
Referring to fig. 7, fig. 7 is a schematic view showing a sub-flowchart of a method for generating a service code frame according to an embodiment of the present application, and step S2 includes the following sub-steps:
s21, reading JSON data;
step S22, judging whether the JSON data is successfully read, if so, executing step S23, and if not, executing step S24;
step S23, creating a load folder path, and executing step S25;
step S24, throwing out JSON data, judging reading abnormality and ending the flow;
step S25, judging whether the load folder path is successfully created, if so, executing step S26, and if not, executing step S27;
step S26, traversing JSON data, and executing step S28;
step S27, judging that the created path is abnormal, throwing out the created path, and ending the flow;
step S28, judging whether the traversal is finished, if so, executing step S29, and if not, executing step S30;
step S29, the generation of the service code frame is successful;
step S30, analyzing the JSON data by using a server code frame generation program to obtain interface object data, and executing step S31;
step S31, judging whether the format of the interface object data is wrong, if yes, executing step S32, and if no, executing step S33;
step S32, judging that the data format is abnormal, throwing out the data format, and ending the flow;
and step S33, creating a corresponding file in a corresponding folder according to the wild card in the service framework code template by using the interface object data, writing a code, and returning to the step S28.
When a service code frame is generated by combining with JSON data, a service dependent interface required by a JSON file definition system is used for writing a key value corresponding to a JSON object to determine the specific type and implementation mode of the interface.
The interface type of the request response type will generate a synchronous call interface and an asynchronous call interface at the caller layer respectively, generate a corresponding response interface at the svr layer and generate a corresponding specific implementation manner at the repl layer.
The type of interface that publishes the subscription generates a synchronous or asynchronous call interface at the caller layer according to the user's choice, a corresponding response interface at the svr layer and a corresponding specific implementation at the impl layer,
when the asynchronous call interface is selected, a callback function required by asynchronous call is registered through the server-side repl layer, and when the synchronous call interface is selected, a corresponding data localization method is generated at the client interface encapsulation layer.
When a servicecode frame is generated by combining a servicecode frame generating program written in the Go language, the servicecode frame generating program analyzes JSON data, realizes communication and calling methods of service call according to a specified path, classifies other dependent files into dry folders according to functions, and generates a project engineering folder structure.
The server code frame generating program generates a corresponding function according to the wild card in the server frame code template and the interface structure designed previously, generates the filled code into the code file and puts the code file into the position corresponding to the folder generated in the last step, and the generated code file is a compilable QT project after correctly linking the third party library required by the project.
Compared with the prior art, the beneficial effects of this application are:
compared with the existing transmission control protocol, the method for generating the service code frame has a higher-level abstract interface, so that a developer can call remote service like a local function, and the frame also shields bottom details of remote call, so that development efficiency is further improved.
Secondly, compared with the existing hypertext transfer protocol, the method for generating the service code framework uses a more efficient binary protocol for data transfer, which means that lower delay and higher throughput can be provided for the system, and meanwhile, the framework also provides more interface realization modes, and a developer can select a proper serialization mode, a load balancing strategy, a data compression algorithm and the like according to requirements and support advanced characteristics such as asynchronous calling, streaming data transfer and the like.
Thirdly, compared with the existing remote procedure call protocol (RPC framework), the method for generating the service code framework provides a more flexible design mode of the service framework, improves the design efficiency of the service system by using JSON as an interface design mode, reduces the threshold of development and maintenance under the condition that the data transmission performance is not excessively influenced by introducing QT framework content, simultaneously further separates the specific realization of a service interface and the method on the basis of shielding network communication details of a bottom layer, and improves the development efficiency.
A possible implementation manner of the service code frame generating device is provided below, which is used to execute the respective execution steps and corresponding technical effects of the service code frame generating method shown in the foregoing embodiments and possible implementation manners.
The device comprises a service frame design module and a service frame generation module;
the service framework design module is used for designing a service framework code template based on the relation between the client and the server;
and the service frame generation module is used for generating the service code frame by using the service frame code template, the service code frame generation program written in the Go language and the JSON data.
The preferred embodiment provides a computer device, which can implement the steps in any embodiment of the method for generating a service code frame provided in the embodiment of the present application, so that the beneficial effects of the method for generating a service code frame provided in the embodiment of the present application can be achieved, and detailed descriptions of the foregoing embodiments are omitted herein.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, embodiments of the present application provide a storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the embodiments of the method for generating a server code framework provided by embodiments of the present application.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps in any of the embodiments of the method for generating a service code frame provided in the embodiments of the present application may be executed by the instructions stored in the storage medium, so that the beneficial effects that any of the embodiments of the method for generating a service code frame provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not described herein again.
The foregoing description of the preferred embodiments of the present application is not intended to be limiting, but is intended to cover any and all modifications, equivalents, and alternatives falling within the spirit and principles of the present application.

Claims (10)

1. A method of generating a service code frame, the method being applied to a service code frame generating apparatus, the apparatus comprising a service frame design module and a service frame generating module, the method comprising:
designing a service framework code template based on the relation between the client and the server through a service framework design module;
the service frame is generated by the service frame generation module by using the service frame code template, the service code frame generation program written in the Go language and the JSON data.
2. The method of claim 1, wherein the step of designing the service framework code template based on the relationship between the client and the server by the service framework design module comprises:
selecting a shell layer of a client and a proxy layer, a svr layer and an impl layer of a server;
and packaging a plurality of services in the teller layer into a dependent layer, and combining a proxy layer, a svr layer and an repl layer of the service end to obtain the service framework code template.
3. The method of claim 2, wherein the interface types of the service framework code template are defined as a request response type, a publish-subscribe type, and an event notification type;
interface corresponding functions are written in the serviced frame code templates in the form of wild cards.
4. The method for generating a service code framework according to claim 3, wherein the request response type enables the user to call a synchronous interface or an asynchronous interface to realize a synchronous or asynchronous request response function, wherein the synchronous interface returns to the user through a proxy layer after the server calls a realization function, and the asynchronous interface returns to the user through a callback function and the proxy layer after the server calls the realization function.
5. The method for generating a service code framework according to claim 3, wherein the type of the interface of the publish-subscribe type supports invoking a synchronous interface or an asynchronous interface to implement a synchronous or asynchronous publish-subscribe function, the publish-subscribe function is to send data to a user according to a publish-subscribe form, the synchronous interface invokes an repl layer to send a change event to a svr layer, the change event is synchronized to a teller layer through a proxy layer, the asynchronous interface invokes the repl layer to send the change event to a svr layer, and the change event is asynchronously sent to a client through the proxy layer.
6. The method of claim 3, wherein the event notification type interface type sends the event to the subscriber in the form of a publish-subscribe, and the event notification type interface call is an asynchronous call.
7. The method of generating a serviced code frame according to claim 1, wherein the step of generating the serviced code frame by the service frame generation module using the serviced code frame template, the serviced code frame generation program written in Go language, and JSON data, comprises:
s21, reading JSON data;
step S22, judging whether the JSON data is successfully read, if so, executing step S23, and if not, executing step S24;
step S23, creating a load folder path, and executing step S25;
step S24, throwing out JSON data, judging reading abnormality and ending the flow;
step S25, judging whether the load folder path is successfully created, if so, executing step S26, and if not, executing step S27;
step S26, traversing JSON data, and executing step S28;
step S27, judging that the created path is abnormal, throwing out the created path, and ending the flow;
step S28, judging whether the traversal is finished, if so, executing step S29, and if not, executing step S30;
step S29, the generation of the service code frame is successful;
step S30, analyzing the JSON data by using a server code frame generation program to obtain interface object data, and executing step S31;
step S31, judging whether the format of the interface object data is wrong, if yes, executing step S32, and if no, executing step S33;
step S32, judging that the data format is abnormal, throwing out the data format, and ending the flow;
and step S33, creating a corresponding file in a corresponding folder according to the wild card in the service framework code template by using the interface object data, writing a code, and returning to the step S28.
8. A service code frame generation device, characterized in that the device comprises a service frame design module and a service frame generation module;
the service framework design module is used for designing a service framework code template based on the relation between the client and the server;
and the service frame generation module is used for generating the service code frame by using the service frame code template, the service code frame generation program written in the Go language and the JSON data.
9. A computer device comprising a processor and a memory, the memory having stored therein a computer program that is loaded and executed by the processor to implement the method of servitizing code framework generation of any of claims 1-7.
10. A computer readable storage medium, characterized in that the storage medium has stored therein a computer program, which is loaded and executed by a processor to implement the method of generating a serviced code framework according to any one of claims 1-7.
CN202410046267.8A 2024-01-12 2024-01-12 Method, device, equipment and medium for generating service code frame Active CN117555528B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410046267.8A CN117555528B (en) 2024-01-12 2024-01-12 Method, device, equipment and medium for generating service code frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410046267.8A CN117555528B (en) 2024-01-12 2024-01-12 Method, device, equipment and medium for generating service code frame

Publications (2)

Publication Number Publication Date
CN117555528A true CN117555528A (en) 2024-02-13
CN117555528B CN117555528B (en) 2024-03-26

Family

ID=89817115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410046267.8A Active CN117555528B (en) 2024-01-12 2024-01-12 Method, device, equipment and medium for generating service code frame

Country Status (1)

Country Link
CN (1) CN117555528B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180270290A1 (en) * 2017-03-15 2018-09-20 Commvault Systems, Inc. Remote commands framework to control clients
CN109840155A (en) * 2017-11-24 2019-06-04 中兴通讯股份有限公司 A kind of method and device for realizing remote procedure call
CN110727416A (en) * 2019-10-10 2020-01-24 广州趣丸网络科技有限公司 Development framework generation method and related device
CN112035276A (en) * 2020-08-06 2020-12-04 上海视云网络科技有限公司 Java-based cross-platform extensible Remote Procedure Call (RPC) framework design method
CN112612452A (en) * 2020-12-18 2021-04-06 华人运通(上海)云计算科技有限公司 API platform implementation method, device, equipment and storage medium
US11010191B1 (en) * 2020-07-02 2021-05-18 Ryan L. Hornbeck Platform-independent interface for generating virtualized multi-service hardware systems and infrastructure
CN114398191A (en) * 2021-12-23 2022-04-26 杭州安恒信息技术股份有限公司 Remote service calling method, system, computer equipment and storage medium
CN115061690A (en) * 2022-05-23 2022-09-16 贝壳找房(北京)科技有限公司 Automatic code generation method and device
CN115408169A (en) * 2022-08-02 2022-11-29 武汉烽火技术服务有限公司 Remote procedure calling method, device, equipment and readable storage medium
CN116450234A (en) * 2023-03-28 2023-07-18 北京仿真中心 C++ model library service packaging framework system and method
CN116931910A (en) * 2022-03-30 2023-10-24 腾讯科技(深圳)有限公司 Development method and device based on protocol framework, electronic equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180270290A1 (en) * 2017-03-15 2018-09-20 Commvault Systems, Inc. Remote commands framework to control clients
CN109840155A (en) * 2017-11-24 2019-06-04 中兴通讯股份有限公司 A kind of method and device for realizing remote procedure call
CN110727416A (en) * 2019-10-10 2020-01-24 广州趣丸网络科技有限公司 Development framework generation method and related device
US11010191B1 (en) * 2020-07-02 2021-05-18 Ryan L. Hornbeck Platform-independent interface for generating virtualized multi-service hardware systems and infrastructure
CN112035276A (en) * 2020-08-06 2020-12-04 上海视云网络科技有限公司 Java-based cross-platform extensible Remote Procedure Call (RPC) framework design method
CN112612452A (en) * 2020-12-18 2021-04-06 华人运通(上海)云计算科技有限公司 API platform implementation method, device, equipment and storage medium
CN114398191A (en) * 2021-12-23 2022-04-26 杭州安恒信息技术股份有限公司 Remote service calling method, system, computer equipment and storage medium
CN116931910A (en) * 2022-03-30 2023-10-24 腾讯科技(深圳)有限公司 Development method and device based on protocol framework, electronic equipment and storage medium
CN115061690A (en) * 2022-05-23 2022-09-16 贝壳找房(北京)科技有限公司 Automatic code generation method and device
CN115408169A (en) * 2022-08-02 2022-11-29 武汉烽火技术服务有限公司 Remote procedure calling method, device, equipment and readable storage medium
CN116450234A (en) * 2023-03-28 2023-07-18 北京仿真中心 C++ model library service packaging framework system and method

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
ANDREW HOWELL等: "Measuring node decentralisation in blockchain peer to peer networks", BLOCKCHAIN: RESEARCH AND APPLICATIONS, vol. 4, no. 1, 8 February 2023 (2023-02-08), pages 1 - 11 *
FENG LIN等: "Applying Safe Regression Test Selection Techniques to Java Web Services", INTERNATIONAL CONFERENCE ON NEXT GENERATION WEB SERVICES PRACTICES, 12 February 2007 (2007-02-12), pages 1 - 8 *
GABOR KECSKEMETI等: "An approach for virtual appliance distribution for service deployment", FUTURE GENERATION COMPUTER SYSTEMS, vol. 27, no. 3, 25 September 2010 (2010-09-25), pages 280 - 289, XP027494349, DOI: 10.1016/j.future.2010.09.009 *
李军: "自动监控的微服务应用开发框架的设计与实现", 中国优秀硕士学位论文全文数据库 信息科技辑, no. 5, 15 May 2022 (2022-05-15), pages 138 - 158 *
李婉婷: "基于J2EE开发数据交换系统的安全中间件", 中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑, no. 4, 15 April 2006 (2006-04-15), pages 138 - 154 *
林超 等: "基于J2EE与SOA的航运电子商务平台的研究和实现", 电脑知识与技术, vol. 5, no. 20, 15 July 2009 (2009-07-15), pages 5388 - 5389 *

Also Published As

Publication number Publication date
CN117555528B (en) 2024-03-26

Similar Documents

Publication Publication Date Title
US7607128B2 (en) Method and system for enabling a server application to be executed in the same virtual machine as a client application using direct object oriented programming method calls
US6757899B2 (en) Dynamic CORBA gateway for CORBA and non-CORBA clients and services
USRE43375E1 (en) System and method for communications in a distributed computing environment
US7587447B2 (en) Systems, methods and computer programs for implementing and accessing web services
US7028306B2 (en) Systems and methods for implementing modular DOM (Document Object Model)-based multi-modal browsers
US8839194B2 (en) Component-based web application development framework used for creating web page
US20030018832A1 (en) Metadata-aware enterprise application integration framework for application server environment
US8775649B2 (en) Optimizing client code through automated server specialization
EP2307977B1 (en) System and method for dynamic partitioning of applications in client-server environments
US6931455B1 (en) System and method for communications between a CORBA object request broker and a non-CORBA object request broker
US20040220952A1 (en) Web service gateway generation
US6405264B1 (en) Marshaling and unmarshaling framework for supporting filters in a distributed object system
US20130160064A1 (en) Distributed System Architecture for Control of a Set Top Box
US20030233477A1 (en) Extensible infrastructure for manipulating messages communicated over a distributed network
WO2011044692A1 (en) System and method for managing applications for multiple computing endpoints and multiple endpoint types
US20050003810A1 (en) Method and system for optimizing software program start-up time
US20120226737A1 (en) Method and system for reducing service overhead in service oriented architectures
CN111506368B (en) Method, device, equipment and storage medium for converting asynchronous call into synchronous call
US20080216050A1 (en) Method and System for Accessing a Resource Implemented in a Computer Network
US8260944B2 (en) Using a state machine embedded within a session initiation protocol (SIP) servlet to implement an application programming interface (API)
CN117555528B (en) Method, device, equipment and medium for generating service code frame
US8024746B2 (en) Common handler framework
CN113542217B (en) Service subscription system
CN114816357A (en) Service arrangement system for serving process bank
JP2006236375A (en) Web application development method, development support system, and program about development method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant