CN117519670A - Method and system for automatically generating RPC (remote procedure control) codes - Google Patents

Method and system for automatically generating RPC (remote procedure control) codes Download PDF

Info

Publication number
CN117519670A
CN117519670A CN202311794230.5A CN202311794230A CN117519670A CN 117519670 A CN117519670 A CN 117519670A CN 202311794230 A CN202311794230 A CN 202311794230A CN 117519670 A CN117519670 A CN 117519670A
Authority
CN
China
Prior art keywords
call
rpc
interface
busyness
processing
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
CN202311794230.5A
Other languages
Chinese (zh)
Other versions
CN117519670B (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.)
Hangyin Consumer Finance Co ltd
Original Assignee
Hangyin Consumer Finance 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 Hangyin Consumer Finance Co ltd filed Critical Hangyin Consumer Finance Co ltd
Priority to CN202311794230.5A priority Critical patent/CN117519670B/en
Publication of CN117519670A publication Critical patent/CN117519670A/en
Application granted granted Critical
Publication of CN117519670B publication Critical patent/CN117519670B/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/30Creation or generation of source code
    • 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
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote
    • 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
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention provides a method and a system for automatically generating RPC codes, which belong to the technical field of data processing and specifically comprise the following steps: the method comprises the steps of determining the abnormal call data of an RPC interface through historical processing data of the RPC interface, obtaining the abnormal call type of the RPC interface through the abnormal call data, determining the readability requirement value of the RPC interface by combining the abnormal call times of different abnormal call types, obtaining call data amounts of different service call types and service call times of different service call types of the RPC interface, determining the interface processing busyness of the RPC interface by combining the service call busyness of different time periods and the busyness period, determining the rewriting mode of the RPC interface by the readability requirement value and the interface processing busyness when the interface processing busyness of the RPC interface meets the requirement, and automatically generating the RPC code of the RPC interface based on the rewriting mode, so that the processing efficiency of the RPC code generation of the RPC interface is improved.

Description

Method and system for automatically generating RPC (remote procedure control) codes
Technical Field
The invention belongs to the technical field of data processing, and particularly relates to a method and a system for automatically generating RPC codes.
Background
RPC is called Remote Procedure Call-remote procedure call, RPC interface is a remote procedure call which is a protocol that a program can use to request service from another program on another computer in the network, and since the program using RPC does not need to know the condition of network protocol supporting communication, RPC improves the interoperability of the program, but since different service interfaces all need to perform encapsulation and decapsulation of data by adopting RPC codes, how to automatically generate RPC codes of different service interfaces is realized, and reducing the writing test pressure of service personnel becomes a technical problem to be solved.
In order to solve the above technical problems, in the prior art solution, CN111324343a "code generation method and apparatus" describes a code generated according to the interface information by using a template language allowed by a template engine, and renders the code generation template by using the template engine to generate the code, thereby improving the code generation processing efficiency, but at the same time, the following technical problems exist:
in the prior art, the determination of the rewriting manner of the RPC service interface according to the historical call data of different RPC service interfaces is ignored, specifically, the code rewriting of the RPC service interface may cause the readability of the call data of the RPC service interface to be affected to a certain extent, but at the same time, the data transmission pressure of the RPC service interface can be greatly reduced through the Protobuf protocol, so if the rewriting manner of the RPC service interface cannot be determined by combining the data transmission pressures in different historical call data, the pressure of data transmission and processing may become large.
Compared with protocols such as XML, JSON and the like, the Protobuf protocol reduces the pressure of data transmission and processing due to compression processing of call data, but at the same time, the call data is not readable due to compression processing of call data, so that the difficulty of recognition and processing of abnormal call is increased, and if the specific service scene and the abnormal call data in history cannot be considered to determine the rewriting mode of the RPC service interface, the reliability of monitoring and management of the service interface cannot be ensured.
Aiming at the technical problems, the invention provides a method and a system for automatically generating RPC codes.
Disclosure of Invention
In order to achieve the purpose of the invention, the invention adopts the following technical scheme:
according to one aspect of the present invention, a method of automatically generating RPC code is provided.
A method for automatically generating RPC codes, comprising:
s1, determining abnormal call data of an RPC interface through historical processing data of the RPC interface, acquiring an abnormal call type of the RPC interface through the abnormal call data, determining a readability requirement value of the RPC interface by combining the abnormal call times of different abnormal call types, and entering the next step when the readability requirement value meets the requirement;
s2, determining service call times of different time periods and call processing time of different service call times of the RPC interface in the latest preset time based on the historical processing data, and determining service call busyness and busyness time of different time periods by combining delay processing call times in the service call times;
s3, acquiring call data amounts of different service call types and service call times of different service call types of the RPC interface, determining interface processing busyness of the RPC interface by combining service call busyness of different time periods and busyness time periods, and entering the next step when the interface processing busyness of the RPC interface meets the requirements;
and S4, determining a rewriting mode of the RPC interface through the readability requirement value and the interface processing busyness, and automatically generating the RPC code of the RPC interface based on the rewriting mode.
The invention has the beneficial effects that:
1. the readability requirement value of the RPC interface is determined through the abnormal call type of the RPC interface and the abnormal call times of different abnormal call types, so that the accuracy assessment of the readability requirement value, which is the requirement of the angle of the abnormal call type and the abnormal call times on the operation and maintenance reliability of the RPC interface, is realized, and the problem of higher operation and maintenance processing difficulty caused by adopting a specific protocol to automatically generate the RPC code of the RPC interface is avoided.
2. The distribution condition of calling busyness in different time periods and the accurate evaluation of interface processing busyness of the RPC interface by different RPC interfaces due to the difference of the calling data quantity of the calling business types are realized by determining the interface processing busyness of the RPC interface through calling data quantity and business calling times of different business calling types, business calling busyness in different time periods and busyness time periods, so that a foundation is laid for the determination of a differentiated protocol for automatically generating RPC codes of the RPC interface.
3. The rewriting mode of the RPC interface is determined through the readability requirement value and the interface processing busyness, so that the difference of the requirements of different RPC interfaces on the readability requirement value caused by the difference of the operation and maintenance reliability requirements is considered, and the difference of the requirements of different RPC interfaces on the processing of the interface data volume caused by the difference of the busyness of interface call is also considered, thereby realizing the accurate evaluation of the rewriting protocol of the RPC interface and realizing the balanced control of the readability and the interface processing busyness.
The further technical scheme is that the abnormal call data comprises abnormal call times of the RPC interface, moments corresponding to different abnormal call times and abnormal call types of different abnormal call times.
The further technical scheme is that when the readability requirement value does not meet the requirement, the RPC code of the RPC interface is automatically generated through an XML protocol or a JSON protocol.
The further technical scheme is that the delay processing calling times are determined according to the calling processing time of the service calling times, and particularly when the calling processing time is greater than a preset processing time threshold, the service calling times are determined to be delay processing calling times.
The further technical scheme is that the method for determining the rewriting mode of the RPC interface comprises the following steps:
when the readability requirement value is larger than the interface processing busyness, automatically generating an RPC code of the RPC interface through an XML protocol or a JSON protocol;
and when the readability requirement value is not greater than the interface processing busyness, automatically generating the RPC code of the RPC interface through a Protobuf protocol.
In a second aspect, the present invention provides a computer system comprising: a communicatively coupled memory and processor, and a computer program stored on the memory and capable of running on the processor, characterized by: the processor, when executing the computer program, performs one of the methods described above for automatically generating RPC code.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention as set forth hereinafter.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
The above and other features and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings;
FIG. 1 is a flow chart of a method of automatically generating RPC code;
FIG. 2 is a flow chart of a method of determining a readability requirement value for an RPC interface;
fig. 3 is a flow chart of a method of determination of a busy period;
FIG. 4 is a flow chart of a method of an interface of an RPC interface to handle determination of busyness;
FIG. 5 is a block diagram of a computer system.
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present disclosure.
The WEB end, the android client end and the apple client end of the financial institution can all realize the processing of the credit application of the user, and in the processing process of the credit application, the RPC interface of the rear end, such as the credit interface of the rear end, the gateway interface, the login interface, the exit interface, the home page interface, the branch interface, the repayment interface, the credit interface and the like, are required to be called, and the processing efficiency and the readability can not meet the requirements due to a large number of differences of data interaction modes among different interfaces, so that the rewriting processing of call data of different interfaces is required to be carried out based on the service requirements.
When the RPC code of the RPC interface is automatically generated, compared with the protocols such as XML and JSON, the Protobuf protocol reduces the pressure of data transmission and processing due to the compression processing of call data, but at the same time, the call data is not readable due to the compression processing of call data, so that the difficulty of recognition and processing of abnormal call is increased, and therefore, if the determination of the automatic generation mode cannot be comprehensively considered on the busyness of the service processing of the RPC interface and the abnormal condition of the historical operation, the requirement of data compression of the service processing and the requirement of the readability of operation and maintenance management cannot be simultaneously considered.
In order to solve the technical problems, the following technical scheme is adopted:
firstly, determining an abnormal call type of an RPC interface and the abnormal call times of different abnormal call types through historical processing data of the RPC interface, and carrying out the readability requirement value of the RPC interface through the abnormal call types of the RPC interface and the abnormal call times of different abnormal call types, specifically, determining the abnormal evaluation amounts of different abnormal call types through the ratio of the abnormal call times of different abnormal call types to the preset call times, then carrying out the readability requirement value of the RPC interface according to the number of the abnormal evaluation amounts of different abnormal call types, and entering the next step when the readability requirement value is smaller, and carrying out the automatic generation of the RPC code of the RPC interface through an XML protocol or a JSON protocol when the readability requirement value is larger;
then, based on historical processing data, determining service call times of RPC interfaces in different time periods and call processing time of different service call times in the latest preset time, determining service call busyness and busyness of different time periods by combining delay processing call times in the service call times, specifically, determining the time periods as busyness time periods by the ratio of the service call times of different time periods to the preset service call times, the number of the delay processing call times in the service call times after normalization processing of the duty ratio of the service call times and the average value of call processing time of the different service call times and the service call busyness of different time periods, and determining the time periods as busyness time periods when the service call busyness of the time periods is large;
then, acquiring call data amounts of different service call types and service call times of different service call types of the RPC interface, determining interface processing busyness of the RPC interface by combining the service call busyness of different time periods and busyness time periods, specifically, determining weight values of different service call types by the product of the ratio of the call data amounts of the different service call types to the average value of the call data amounts of all the service call types and the ratio of the service call times to the average value of the service call times of all the service call types, finally determining the busyness of the interface processing busyness of the RPC interface according to the number of the weight values of the different service call types and the number of the duty ratios of the busyness time periods, entering the next step when the interface processing busyness of the RPC interface is smaller, and automatically generating RPC codes of the RPC interface by a Protobuf protocol when the interface processing busyness of the RPC interface is larger;
finally, determining a rewriting mode of the RPC interface through a readability requirement value and interface processing busyness, and automatically generating an RPC code of the RPC interface based on the rewriting mode, wherein when the readability requirement value is larger than the interface processing busyness, the RPC code of the RPC interface is automatically generated through an XML protocol or a JSON protocol; and when the readability requirement value is not greater than the interface processing busyness, automatically generating the RPC code of the RPC interface through a Protobuf protocol.
The following will be elaborated from both a method class and a system class.
To solve the above problem, according to one aspect of the present invention, as shown in fig. 1, there is provided a method for automatically generating an RPC code, which specifically includes:
s1, determining abnormal call data of an RPC interface through historical processing data of the RPC interface, acquiring an abnormal call type of the RPC interface through the abnormal call data, determining a readability requirement value of the RPC interface by combining the abnormal call times of different abnormal call types, and entering the next step when the readability requirement value meets the requirement;
specifically, the exception call data includes the exception call times of the RPC interface, moments corresponding to different exception call times, and exception call types of different exception call times.
In one possible embodiment, as shown in fig. 2, the method for determining the readability requirement value of the RPC interface in the step S1 is as follows:
s11, acquiring the abnormal call times of the RPC interface, determining whether the abnormal call times meet the requirements or not based on the service call times of the RPC interface, if yes, entering the next step, and if not, determining that the readability requirement value of the RPC interface does not meet the requirements;
s12, determining the abnormal call times of different abnormal call types of the RPC interface through the abnormal call times of the RPC interface, judging whether the abnormal call types with the abnormal call times being larger than the preset call times exist or not, if so, entering the next step, and if not, entering the step S14;
s13, taking the abnormal call type with the abnormal call times larger than the preset call times as an attention abnormal call type, judging whether the type number of the attention abnormal call type of the RPC interface meets the requirement, if so, entering the next step, and if not, determining that the readability requirement value of the RPC interface does not meet the requirement;
s14, carrying out average value of time intervals of different abnormal call times of different abnormal call types and determination of the abnormal call times smaller than a preset time interval according to the time intervals of the different abnormal call times of the different abnormal call types, carrying out determination of abnormal evaluation amounts of the different abnormal call types by combining the abnormal call times of the different abnormal call types, judging whether the number of types of the abnormal call types which are not satisfied with the requirements by the abnormal evaluation amounts satisfies the requirements, if yes, entering the next step, and if no, determining that the readability requirement value of the RPC interface is not satisfied with the requirements;
in a possible embodiment, determining the frequency abnormality degree of the abnormal call type by the ratio of the average value of time intervals of different abnormal call times to the preset time interval, then determining the call abnormality degree of the abnormal call type by the ratio of the abnormal call times smaller than the preset time interval and the call times of the abnormal call times of the RPC interface, and finally determining the number of the abnormal call type after normalization processing and the abnormality evaluation amount of the abnormal call type by the frequency abnormality degree of the abnormal call type and the call abnormality degree.
S15, acquiring the abnormal call times and the type number of the abnormal call types of the RPC interface, and determining the readability requirement value of the RPC interface by combining the abnormal evaluation values of different abnormal call types and the type number of the abnormal call types, the abnormal evaluation values of which do not meet the requirements.
It can be understood that the average value of the exception evaluation is determined by the exception evaluation of different exception call types and the number of types of exception call types, then the complexity of the exception call types of the RPC interface is determined by the ratio of the number of types of exception call types which do not meet the requirement of the exception evaluation to the number of preset types, and finally the average value of the exception evaluation, the complexity of the exception call types of the RPC interface, the number of ratios of the number of exception calls to the number of calls and the readability requirement value of the RPC interface are determined.
It should be further noted that, when the readability requirement value does not meet the requirement, the automatic generation of the RPC code of the RPC interface is performed through an XML protocol or JSON protocol.
In another possible embodiment, the method for determining the readability requirement value of the RPC interface in the step S1 is as follows:
when the number of abnormal call times or the number of types of the abnormal call types of the RPC interface do not meet the requirement, determining that the readability requirement value of the RPC interface does not meet the requirement;
when the number of the abnormal call times and the number of types of the abnormal call types of the RPC interface meet the requirements, determining the average value of the time intervals of the different abnormal call times of the different abnormal call types and the abnormal call times smaller than the preset time interval according to the time intervals of the different abnormal call times of the different abnormal call types, and determining the abnormal evaluation quantity of the different abnormal call types by combining the abnormal call times of the different abnormal call types;
judging whether the type number of the abnormal call types which do not meet the requirements of the abnormal evaluation is met, if yes, entering the next step, and if not, determining that the readability requirement value of the RPC interface does not meet the requirements;
and acquiring the abnormal call times and the type number of the abnormal call types of the RPC interface, and determining the readability requirement value of the RPC interface by combining the abnormal evaluation values of different abnormal call types and the type number of the abnormal call types, the abnormal evaluation values of which do not meet the requirement.
In this embodiment, the readability requirement value of the RPC interface is determined by the exception call type of the RPC interface and the exception call times of different exception call types, so that the accuracy assessment of the readability requirement value is realized from the angles of the exception call types and the exception call times in the history call process of the RPC interface, and the problem of higher difficulty in operation and maintenance processing caused by automatic generation of the RPC code of the RPC interface by adopting a specific protocol is avoided.
S2, determining service call times of different time periods and call processing time of different service call times of the RPC interface in the latest preset time based on the historical processing data, and determining service call busyness and busyness time of different time periods by combining delay processing call times in the service call times;
it should be further noted that, the number of times of delay processing call is determined according to the call processing time of the number of times of service call, and specifically, when the call processing time is greater than a preset processing time threshold, the number of times of service call is determined to be the number of times of delay processing call.
In one possible embodiment, as shown in fig. 3, the method for determining the busy period in step S2 is as follows:
s21, acquiring the service call times of the RPC interface in the time period, determining whether the time period belongs to a busy time period based on the service call times, if so, determining that the time period belongs to the busy time period, determining the service call busyness of the time period according to the service call times of the time period, and if not, entering the next step;
s22, judging whether the RPC interface has time delay processing calling times in the period, if so, entering a step S24, and if not, entering a next step;
s23, judging whether the service call times of the RPC interface in the time period is smaller than the preset service call times, if so, determining that the time period does not belong to a busy time period, determining the service call busyness of the time period according to the service call times of the time period, and if not, entering the next step;
s24, acquiring time delay processing calling times of the RPC interface in the time period and time intervals of different time delay processing calling times, and determining the time delay processing busyness of the time period by combining the accumulated processing time length of the RPC interface corresponding to the different time delay processing times;
s25, determining call processing time of different service call times according to historical processing data of the RPC interface, determining service call busyness of the time period according to the service call times and delay processing busyness of the time period, and determining whether the time period belongs to a busyness time period according to the service call busyness.
Specifically, determining whether the period belongs to a busy period according to the service call busyness includes:
and when the business call busyness of the time period is larger than the preset busyness, determining that the time period belongs to the busyness time period.
In another possible embodiment, the method for determining the busy period in the step S2 is as follows:
acquiring the service call times of the RPC interface in the time period, when the service call times of the time period are larger than a preset call times limiting value, determining that the time period belongs to a busy time period, and determining the service call busyness of the time period through the service call times of the time period;
when the service calling times of the time period is not more than a preset calling times limiting value:
acquiring the determination of the call processing time of different service call times of the RPC interface in the time period, when the total duration of the call processing time of the service call times in the time period is greater than the preset duration, determining that the time period belongs to a busy time period, and determining the service call busyness of the time period through the total duration of the call processing time of the service call times in the time period;
when the total duration of the call processing time of the service call times of the time period is not more than the preset duration:
acquiring the time delay processing calling times of the RPC interface in the time period and the time intervals of different time delay processing calling times, and determining the time delay processing busyness of the time period by combining the accumulated processing time length of the RPC interface corresponding to different time delay processing times;
and determining call processing time of different service call times through historical processing data of the RPC interface, determining service call busyness of the time period by combining the service call times of the time period and delay processing busyness, and determining whether the time period belongs to a busyness time period or not through the service call busyness.
S3, acquiring call data amounts of different service call types and service call times of different service call types of the RPC interface, determining interface processing busyness of the RPC interface by combining service call busyness of different time periods and busyness time periods, and entering the next step when the interface processing busyness of the RPC interface meets the requirements;
in one possible embodiment, as shown in fig. 4, the method for determining the interface processing busyness of the RPC interface in the step S3 includes:
s31, determining the interface basic processing busyness of the RPC interface through the call data volume of different service call types and the service call times of different service call types of the RPC interface;
s32, determining the number of idle call periods of the RPC interface through the service call busyness of the RPC interface in different periods, judging whether the number of the idle call periods of the RPC interface meets the requirement or not, if so, entering the next step, and if not, entering the step S34;
s33, judging whether the number duty ratio of the busy periods of the RPC interface meets the requirement, if so, taking the interface basic processing busyness of the RPC interface as the interface processing busyness of the RPC interface, and if not, entering step S34;
s34, acquiring the number of idle call periods and the business call busyness of different idle call periods of the RPC interface, determining the distribution uniformity of the call processing busyness of the RPC interface by combining the number of busyness periods of the RPC interface and the business call busyness of different busyness periods, and determining the interface processing busyness of the RPC interface by combining the interface basic processing busyness of the RPC interface.
Specifically, when the interface processing busyness of the RPC interface does not meet the requirement, the automatic generation of the RPC code of the RPC interface is performed through a Protobuf protocol.
In this embodiment, the determination of the interface processing busyness of the RPC interface is performed by calling data volume and the number of service calls of different service call types, the busyness of the service call of different time periods, and the busyness of the interface processing of the RPC interface is performed in the busyness time period, so that the distribution situation of calling busyness of different time periods and the accurate evaluation of the interface processing busyness of the RPC interface by different RPC interfaces due to the difference of the calling data volume of the calling service types are realized, thereby laying a foundation for the determination of the protocol for performing the automatic generation of the RPC code of the RPC interface in a differentiated manner.
And S4, determining a rewriting mode of the RPC interface through the readability requirement value and the interface processing busyness, and automatically generating the RPC code of the RPC interface based on the rewriting mode.
In one possible embodiment, the method for determining the overwriting manner of the RPC interface in the step S4 is as follows:
when the readability requirement value is larger than the interface processing busyness, automatically generating an RPC code of the RPC interface through an XML protocol or a JSON protocol;
and when the readability requirement value is not greater than the interface processing busyness, automatically generating the RPC code of the RPC interface through a Protobuf protocol.
In this embodiment, the rewriting manner of the RPC interface is determined by the readability requirement value and the interface processing busyness, which not only considers the difference of the requirements of different RPC interfaces on the readability requirement value caused by the difference of the operation and maintenance reliability requirements, but also considers the difference of the requirements of different RPC interfaces on the processing of the interface data amount caused by the difference of the busyness of the interface call, thereby realizing the accurate evaluation of the rewriting protocol of the RPC interfaces and realizing the balanced control of the readability and the interface processing busyness.
For ease of understanding, the following will be further described in connection with specific business requirements:
the WEB end, the android client end and the apple client end of the financial institution can all realize the processing of the credit application of the user, and in the processing process of the credit application, the RPC interface of the rear end, such as the credit interface of the rear end, the gateway interface, the login interface, the exit interface, the home page interface, the branch interface, the repayment interface, the credit interface and the like, are required to be called, and the processing efficiency and the readability can not meet the requirements due to a large number of differences of data interaction modes among different interfaces, so that the rewriting processing of call data of different interfaces is required to be carried out based on the service requirements.
Firstly, determining the abnormal call type of the RPC interface and the abnormal call times of different abnormal call types through the RPC interface, such as a credit interface, a gateway interface, a login interface, an exit interface, a home page interface, a branch interface and a repayment interface at the rear end, so as to determine the readability requirement value by adopting the mode of the invention patent, and automatically generating the RPC code of the RPC interface by adopting an XML protocol or a JSON protocol to the RPC interface because the readability requirement value of the credit interface, the gateway interface, the branch interface and the repayment interface is larger in actual use;
then according to the login interface, the exit interface and the history processing data of the home page interface, the service calling times of the RPC interface in different time periods and the calling processing time of different service calling times are determined in the latest preset time, and the service calling busyness of different time periods and the busyness time period are determined by combining the time delay processing calling times in the service calling times;
then, acquiring call data amounts of different service call types and service call times of different service call types of the RPC interface, and determining interface processing busyness of the RPC interface by combining the service call busyness of different time periods and busyness time periods, wherein the interface processing busyness of the RPC interface can be determined in any mode specifically, the interface processing busyness of the login interface is 0.9 in the actual operation process, the interface is exited, the interface processing busyness of the home page interface is 0.3 and 0.5, and the interface processing busyness of the login interface is larger, so that the RPC code of the login interface is automatically generated through a Protobuf protocol;
finally, determining a rewriting mode of the RPC interface through a readability requirement value and interface processing busyness, and automatically generating an RPC code of the RPC interface based on the rewriting mode, wherein when the readability requirement value is larger than the interface processing busyness, the RPC code of the RPC interface is automatically generated through an XML protocol or a JSON protocol; when the readability requirement value is not greater than the interface processing busyness, the RPC code of the RPC interface is automatically generated through a Protobuf protocol, and in the actual operation process, the RPC code of the RPC interface is automatically generated through the Protobuf protocol for both the exit interface and the home page interface.
In another aspect, as shown in FIG. 5, the present invention provides a computer system comprising: a communicatively coupled memory and processor, and a computer program stored on the memory and capable of running on the processor, characterized by: the processor, when executing the computer program, performs one of the methods described above for automatically generating RPC code.
The method for automatically generating the RPC code specifically comprises the following steps:
determining abnormal call data of an RPC interface through historical processing data of the RPC interface, and determining that the readability requirement value of the RPC interface does not meet the requirement when the abnormal call times or the type number of the abnormal call types of the RPC interface do not meet the requirement;
when the number of the abnormal call times and the number of types of the abnormal call types of the RPC interface meet the requirements, determining the average value of the time intervals of the different abnormal call times of the different abnormal call types and the abnormal call times smaller than the preset time interval according to the time intervals of the different abnormal call times of the different abnormal call types, and determining the abnormal evaluation quantity of the different abnormal call types by combining the abnormal call times of the different abnormal call types;
judging whether the type number of the abnormal call types which do not meet the requirements of the abnormal evaluation is met, if yes, entering the next step, and if not, determining that the readability requirement value of the RPC interface does not meet the requirements;
acquiring the abnormal call times and the type number of the abnormal call types of the RPC interface, determining a readability requirement value of the RPC interface by combining the abnormal evaluation values of different abnormal call types and the type number of the abnormal call types, which do not meet the requirements, and entering the next step when the readability requirement value meets the requirements;
acquiring the service call times of the RPC interface in the time period, when the service call times of the time period are larger than a preset call times limiting value, determining that the time period belongs to a busy time period, and determining the service call busyness of the time period through the service call times of the time period;
when the service calling times of the time period is not more than a preset calling times limiting value:
acquiring the determination of the call processing time of different service call times of the RPC interface in the time period, when the total duration of the call processing time of the service call times in the time period is greater than the preset duration, determining that the time period belongs to a busy time period, and determining the service call busyness of the time period through the total duration of the call processing time of the service call times in the time period;
when the total duration of the call processing time of the service call times of the time period is not more than the preset duration:
acquiring the time delay processing calling times of the RPC interface in the time period and the time intervals of different time delay processing calling times, and determining the time delay processing busyness of the time period by combining the accumulated processing time length of the RPC interface corresponding to different time delay processing times;
determining call processing time of different service call times through historical processing data of the RPC interface, determining service call busyness of the time period by combining the service call times of the time period and delay processing busyness, and determining whether the time period belongs to a busyness time period or not through the service call busyness;
acquiring call data amounts of different service call types and service call times of different service call types of the RPC interface, determining interface processing busyness of the RPC interface by combining service call busyness of different time periods and busyness time periods, and entering the next step when the interface processing busyness of the RPC interface meets the requirement;
when the readability requirement value is larger than the interface processing busyness, automatically generating an RPC code of the RPC interface through an XML protocol or a JSON protocol;
and when the readability requirement value is not greater than the interface processing busyness, automatically generating the RPC code of the RPC interface through a Protobuf protocol.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for apparatus, devices, non-volatile computer storage medium embodiments, the description is relatively simple, as it is substantially similar to method embodiments, with reference to the section of the method embodiments being relevant.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The foregoing is merely one or more embodiments of the present description and is not intended to limit the present description. Various modifications and alterations to one or more embodiments of this description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of one or more embodiments of the present description, is intended to be included within the scope of the claims of the present description.

Claims (10)

1. A method for automatically generating RPC codes, comprising:
determining the abnormal call data of the RPC interface through the history processing data of the RPC interface, acquiring the abnormal call type of the RPC interface through the abnormal call data, determining the readability requirement value of the RPC interface by combining the abnormal call times of different abnormal call types, and entering the next step when the readability requirement value meets the requirement;
determining service call times of different time periods and call processing time of different service call times of the RPC interface in the latest preset time based on the historical processing data, and determining service call busyness and busyness time of different time periods by combining delay processing call times in the service call times;
acquiring call data amounts of different service call types and service call times of different service call types of the RPC interface, determining interface processing busyness of the RPC interface by combining service call busyness of different time periods and busyness time periods, and entering the next step when the interface processing busyness of the RPC interface meets the requirement;
and determining a rewriting mode of the RPC interface through the readability requirement value and the interface processing busyness, and automatically generating the RPC code of the RPC interface based on the rewriting mode.
2. The method for automatically generating RPC code according to claim 1, wherein the exception call data includes an exception call number of the RPC interface, a time corresponding to the different exception call number, and an exception call type of the different exception call number.
3. The method for automatically generating RPC code according to claim 1, wherein when the readability requirement value does not meet a requirement, then the automatic generation of RPC code of the RPC interface is performed through XML protocol or JSON protocol.
4. The method for automatically generating RPC code according to claim 1, wherein the method for determining the readability requirement value of the RPC interface is:
when the number of abnormal call times or the number of types of the abnormal call types of the RPC interface do not meet the requirement, determining that the readability requirement value of the RPC interface does not meet the requirement;
when the number of the abnormal call times and the number of types of the abnormal call types of the RPC interface meet the requirements, determining the average value of the time intervals of the different abnormal call times of the different abnormal call types and the abnormal call times smaller than the preset time interval according to the time intervals of the different abnormal call times of the different abnormal call types, and determining the abnormal evaluation quantity of the different abnormal call types by combining the abnormal call times of the different abnormal call types;
judging whether the type number of the abnormal call types which do not meet the requirements of the abnormal evaluation is met, if yes, entering the next step, and if not, determining that the readability requirement value of the RPC interface does not meet the requirements;
and acquiring the abnormal call times and the type number of the abnormal call types of the RPC interface, and determining the readability requirement value of the RPC interface by combining the abnormal evaluation values of different abnormal call types and the type number of the abnormal call types, the abnormal evaluation values of which do not meet the requirement.
5. The method for automatically generating RPC codes according to claim 1, wherein the number of delayed call processing times is determined according to a call processing time of the number of service call times, and specifically when the call processing time is greater than a preset processing time threshold, the number of service call times is determined to be the number of delayed call processing times.
6. The method for automatically generating an RPC code according to claim 1, wherein the method for determining the busy period is:
acquiring the service call times of the RPC interface in the time period, when the service call times of the time period are larger than a preset call times limiting value, determining that the time period belongs to a busy time period, and determining the service call busyness of the time period through the service call times of the time period;
when the service calling times of the time period is not more than a preset calling times limiting value:
acquiring the determination of the call processing time of different service call times of the RPC interface in the time period, when the total duration of the call processing time of the service call times in the time period is greater than the preset duration, determining that the time period belongs to a busy time period, and determining the service call busyness of the time period through the total duration of the call processing time of the service call times in the time period;
when the total duration of the call processing time of the service call times of the time period is not more than the preset duration:
acquiring the time delay processing calling times of the RPC interface in the time period and the time intervals of different time delay processing calling times, and determining the time delay processing busyness of the time period by combining the accumulated processing time length of the RPC interface corresponding to different time delay processing times;
and determining call processing time of different service call times through historical processing data of the RPC interface, determining service call busyness of the time period by combining the service call times of the time period and delay processing busyness, and determining whether the time period belongs to a busyness time period or not through the service call busyness.
7. The method for automatically generating an RPC code according to claim 1, wherein determining whether the period belongs to a busy period by the service call busyness comprises:
and when the business call busyness of the time period is larger than the preset busyness, determining that the time period belongs to the busyness time period.
8. The method for automatically generating RPC codes according to claim 1, wherein the method for determining interface processing busyness of the RPC interface is as follows:
s31, determining the interface basic processing busyness of the RPC interface through the call data volume of different service call types and the service call times of different service call types of the RPC interface;
s32, determining the number of idle call periods of the RPC interface through the service call busyness of the RPC interface in different periods, judging whether the number of the idle call periods of the RPC interface meets the requirement or not, if so, entering the next step, and if not, entering the step S34;
s33, judging whether the number duty ratio of the busy periods of the RPC interface meets the requirement, if so, taking the interface basic processing busyness of the RPC interface as the interface processing busyness of the RPC interface, and if not, entering step S34;
s34, acquiring the number of idle call periods and the business call busyness of different idle call periods of the RPC interface, determining the distribution uniformity of the call processing busyness of the RPC interface by combining the number of busyness periods of the RPC interface and the business call busyness of different busyness periods, and determining the interface processing busyness of the RPC interface by combining the interface basic processing busyness of the RPC interface.
9. The method for automatically generating RPC codes according to claim 1, wherein the method for determining the rewriting manner of the RPC interface is as follows:
when the readability requirement value is larger than the interface processing busyness, automatically generating an RPC code of the RPC interface through an XML protocol or a JSON protocol;
and when the readability requirement value is not greater than the interface processing busyness, automatically generating the RPC code of the RPC interface through a Protobuf protocol.
10. A computer system, comprising: a communicatively coupled memory and processor, and a computer program stored on the memory and capable of running on the processor, characterized by: the processor, when running the computer program, performs a method of automatically generating RPC code as claimed in any one of claims 1-9.
CN202311794230.5A 2023-12-25 2023-12-25 Method and system for automatically generating RPC (remote procedure control) codes Active CN117519670B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311794230.5A CN117519670B (en) 2023-12-25 2023-12-25 Method and system for automatically generating RPC (remote procedure control) codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311794230.5A CN117519670B (en) 2023-12-25 2023-12-25 Method and system for automatically generating RPC (remote procedure control) codes

Publications (2)

Publication Number Publication Date
CN117519670A true CN117519670A (en) 2024-02-06
CN117519670B CN117519670B (en) 2024-04-09

Family

ID=89744155

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311794230.5A Active CN117519670B (en) 2023-12-25 2023-12-25 Method and system for automatically generating RPC (remote procedure control) codes

Country Status (1)

Country Link
CN (1) CN117519670B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020073224A1 (en) * 1999-12-01 2002-06-13 The Regents Of The University Of California Method for determining burstiness or a burstiness curve of a traffic source
CN103235718A (en) * 2013-03-28 2013-08-07 迈普通信技术股份有限公司 Method and device for generating remote procedure call (RPC) code
CN103942280A (en) * 2014-04-02 2014-07-23 云南电网公司 Automatic code generating method based on data structure
CN109871289A (en) * 2019-02-01 2019-06-11 北京顺丰同城科技有限公司 A kind of remote procedure call service creation method and device
CN110147225A (en) * 2019-04-02 2019-08-20 平安科技(深圳)有限公司 A kind of code generating method, device and computer equipment, storage medium
CN110673973A (en) * 2019-09-27 2020-01-10 聚好看科技股份有限公司 Application programming interface API (application programming interface) abnormity determining method and device
CN111324343A (en) * 2020-02-20 2020-06-23 支付宝(杭州)信息技术有限公司 Code generation method and device
CN112631569A (en) * 2020-12-30 2021-04-09 上海中通吉网络技术有限公司 gPRC-based method, device and equipment for automatically generating and completing front-end and back-end codes
CN114489597A (en) * 2022-01-17 2022-05-13 徐工汉云技术股份有限公司 Automatic code generation method and device
CN115525260A (en) * 2022-10-08 2022-12-27 在线途游(北京)科技有限公司 Code generation method and device based on protobuf
CN117236903A (en) * 2023-11-09 2023-12-15 浙江浙商互联信息科技有限公司 Intelligent management method and system for high-speed service area

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020073224A1 (en) * 1999-12-01 2002-06-13 The Regents Of The University Of California Method for determining burstiness or a burstiness curve of a traffic source
CN103235718A (en) * 2013-03-28 2013-08-07 迈普通信技术股份有限公司 Method and device for generating remote procedure call (RPC) code
CN103942280A (en) * 2014-04-02 2014-07-23 云南电网公司 Automatic code generating method based on data structure
CN109871289A (en) * 2019-02-01 2019-06-11 北京顺丰同城科技有限公司 A kind of remote procedure call service creation method and device
CN110147225A (en) * 2019-04-02 2019-08-20 平安科技(深圳)有限公司 A kind of code generating method, device and computer equipment, storage medium
CN110673973A (en) * 2019-09-27 2020-01-10 聚好看科技股份有限公司 Application programming interface API (application programming interface) abnormity determining method and device
CN111324343A (en) * 2020-02-20 2020-06-23 支付宝(杭州)信息技术有限公司 Code generation method and device
CN112631569A (en) * 2020-12-30 2021-04-09 上海中通吉网络技术有限公司 gPRC-based method, device and equipment for automatically generating and completing front-end and back-end codes
CN114489597A (en) * 2022-01-17 2022-05-13 徐工汉云技术股份有限公司 Automatic code generation method and device
CN115525260A (en) * 2022-10-08 2022-12-27 在线途游(北京)科技有限公司 Code generation method and device based on protobuf
CN117236903A (en) * 2023-11-09 2023-12-15 浙江浙商互联信息科技有限公司 Intelligent management method and system for high-speed service area

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CHEN, JINGRONG等: "Remote Procedure Call as a Managed System Service", 《 PROCEEDINGS OF THE 20TH USENIX SYMPOSIUM ON NETWORKED SYSTEMS DESIGN AND IMPLEMENTATION, NSDI 2023》, 12 October 2023 (2023-10-12) *
张李攀: "基于协程的分布式RPC框架CO-RPC的设计与实现", 《中国优秀硕士学位论文全文数据库(信息科技辑)》, no. 3, 15 March 2019 (2019-03-15) *
胡焰智;章锋斌;甘志春;田田;尹才华;: "基于场景的移动应用服务QoS建模与评估", 通信学报, no. 1, 25 November 2015 (2015-11-25) *

Also Published As

Publication number Publication date
CN117519670B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
CN105577958B (en) For adjusting distributing strategy and shunting the method, apparatus and system of user's request
CN107809369B (en) Communication state processing method and communication state processing device
CN117519670B (en) Method and system for automatically generating RPC (remote procedure control) codes
US8725868B2 (en) Interactive service management
CN117294657B (en) Flow control method and device
CN101174994A (en) Network card test system and method thereof
CN110727563A (en) Cloud service alarm method and device for preset customer
CN109409948B (en) Transaction abnormity detection method, device, equipment and computer readable storage medium
CN110569238B (en) Data management method, system, storage medium and server based on big data
CN109040075B (en) Management method, server and system for nodes in wireless mobile sensor network
CN114697336B (en) Distributed data switching network system and method based on edge data gateway
CN104486139A (en) System communication detection method and device
CN110942298A (en) Payment data transmission control method and device, electronic equipment and storage medium
CN113344323A (en) Method and device for evaluating service quality of artificial cloud seat in cloud hosting parking lot
CN111723017A (en) System capacity testing method and device, computer equipment and storage medium
CN116843312B (en) Bankruptcy case service system, method and storage medium
CN112799709B (en) Performance and transaction verification method and device for gray release of containers on cloud
CN117648213B (en) Data transmission path model building method and system
CN111131365B (en) Method and system for utilizing idle network resources of networking equipment
CN116954869B (en) Task scheduling system, method and equipment
CN112559561B (en) Data processing method and related device
CN111966510B (en) Method, system, device and medium for calculating data stream
CN116761207B (en) User portrait construction method and system based on communication behaviors
CN117811943A (en) Communication prediction method and device
CN110266818B (en) Management method based on Internet of things terminal group

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