CN110457144A - A kind of method, apparatus that realizing front end applications, medium and equipment - Google Patents

A kind of method, apparatus that realizing front end applications, medium and equipment Download PDF

Info

Publication number
CN110457144A
CN110457144A CN201910715754.8A CN201910715754A CN110457144A CN 110457144 A CN110457144 A CN 110457144A CN 201910715754 A CN201910715754 A CN 201910715754A CN 110457144 A CN110457144 A CN 110457144A
Authority
CN
China
Prior art keywords
information
calling
configuration
request
file
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
CN201910715754.8A
Other languages
Chinese (zh)
Other versions
CN110457144B (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.)
Douyin Vision Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance Network Technology 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910715754.8A priority Critical patent/CN110457144B/en
Publication of CN110457144A publication Critical patent/CN110457144A/en
Application granted granted Critical
Publication of CN110457144B publication Critical patent/CN110457144B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Present disclose provides a kind of method, apparatus for realizing front end applications, medium and electronic equipments.Class libraries is called the described method includes: generating according to the text file of interface description language and configuration file;Wherein, the calling class libraries includes multiple calling classes, and each calling class includes the calling function of multiple encapsulation;The application programming interfaces service of rear end is called based on the configuration information of the calling function and the configuration file.The disclosure automatically generates calling class libraries by the text file and configuration file of interface description language, reduces the workload of developer.The HTTP request message for calling class libraries default sending application in extensive range of generation.And the calling class libraries generated is small in size, meets front end to the high request of code cubage.Scene suitable for Web, WebView and small routine.

Description

A kind of method, apparatus that realizing front end applications, medium and equipment
Technical field
This disclosure relates to which field of computer technology, in particular to a kind of method, apparatus for realizing front end applications, is situated between Matter and electronic equipment.
Background technique
The exploitation of current application program becomes increasingly complex, and rear end is generally using the framework more serviced.It is multiple service usually by Different people's exploitation, it is also possible to be developed using different programming languages.Generally pass through application between multiple services of rear end Routine interface (full name in English Application Programming Interface, abbreviation API) connects.Due to existing Different development languages, thus a variety of development languages is made to call API extremely complex.
Remote procedure call (full name in English Remote Procedure Call, abbreviation RPC) frame shields bottom communication Details provides the API of open and transparent unified telecommunication for a variety of development languages, effectively raises to rear end The development efficiency of API.
But because there is compared with strict requirements code cubage in front end, and the serializing library of RPC frame and API library code Volume is bigger, and the processing of the unserializing of RPC frame, and the exploitation of front end is made not to be available RPC frame substantially.
Summary of the invention
The Summary is provided so that with brief form introduction design, these designs will be in specific implementation below Mode part is described in detail.The Summary is not intended to identify the key feature of claimed technical solution or must Feature is wanted, is intended to be used to limit the range of the technical solution of required protection.
The disclosure is designed to provide a kind of method, apparatus for realizing front end applications, medium and electronic equipment, can solve At least one technical problem certainly mentioned above.Concrete scheme is as follows:
According to the specific embodiment of the disclosure, in a first aspect, the disclosure provides a kind of method for realizing front end applications, packet It includes:
It is generated according to the text file of interface description language and configuration file and calls class libraries;Wherein, the calling class libraries packet Multiple calling classes are included, each calling class includes the calling function of multiple encapsulation;
The application programming interfaces service of rear end is called based on the configuration information of the calling function and the configuration file.
According to the specific embodiment of the disclosure, second aspect, the disclosure provides a kind of device for realizing front end applications, packet It includes:
It generates and calls class library unit, call class for generating according to the text file and configuration file of interface description language Library;Wherein, the calling class libraries includes multiple calling classes, and each calling class includes the calling function of multiple encapsulation;
Call unit calls the application journey of rear end for the configuration information based on the calling function and the configuration file Sequence interface service.
According to the specific embodiment of the disclosure, the third aspect, the disclosure provides a kind of computer readable storage medium, On be stored with computer program, when described program is executed by processor realize realize front end applications as described in any one of first aspect Method.
According to the specific embodiment of the disclosure, fourth aspect, the disclosure provides a kind of electronic equipment, comprising: one or Multiple processors;Storage device, for storing one or more programs, when one or more of programs are by one or more When a processor executes, so that one or more of processors are realized realizing front end applications as described in any one of first aspect Method.
The above scheme of the embodiment of the present disclosure compared with prior art, at least has the advantages that
Present disclose provides a kind of method, apparatus for realizing front end applications, medium and electronic equipments.The described method includes: It is generated according to the text file of interface description language and configuration file and calls class libraries;Wherein, the calling class libraries includes multiple tune With class, each calling class includes the calling function of multiple encapsulation;Based on the configuration for calling function and the configuration file The application programming interfaces service of information calling rear end.
The disclosure automatically generates calling class libraries by the text file and configuration file of interface description language, reduces developer Workload.The HTTP request message for calling class libraries default sending application in extensive range of generation.And the calling class the library generated Product is small, meets front end to the high request of code cubage.Scene suitable for Web, WebView, ReactNative and small routine.
Detailed description of the invention
In conjunction with attached drawing and refer to following specific embodiments, the above and other feature, advantage of each embodiment of the disclosure and Aspect will be apparent.In attached drawing, the same or similar appended drawing reference indicates the same or similar element.It should manage Solution attached drawing is schematically that original part and element are not necessarily drawn to scale.In the accompanying drawings:
Fig. 1 shows the flow chart of the method for the realization front end applications according to the embodiment of the present disclosure;
Fig. 2 shows the unit block diagrams according to the devices of the realization front end applications of the embodiment of the present disclosure;
Fig. 3 shows electronic equipment attachment structure schematic diagram according to an embodiment of the present disclosure.
Specific embodiment
Embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the certain of the disclosure in attached drawing Embodiment, it should be understood that, the disclosure can be realized by various forms, and should not be construed as being limited to this In the embodiment that illustrates, providing these embodiments on the contrary is in order to more thorough and be fully understood by the disclosure.It should be understood that It is that being given for example only property of the accompanying drawings and embodiments effect of the disclosure is not intended to limit the protection scope of the disclosure.
It should be appreciated that each step recorded in disclosed method embodiment can execute in a different order, And/or parallel execution.In addition, method implementation may include additional step and/or omit the step of execution is shown.This public affairs The range opened is not limited in this respect.
Terms used herein " comprising " and its deformation are that opening includes, i.e., " including but not limited to ".Term "based" It is " being based at least partially on ".Term " one embodiment " expression " at least one embodiment ";Term " another embodiment " indicates " at least one other embodiment ";Term " some embodiments " expression " at least some embodiments ".The correlation of other terms is fixed Justice provides in will be described below.
It is noted that the concepts such as " first " that refers in the disclosure, " second " are only used for different devices, module or list Member distinguishes, and is not intended to limit the sequence or relation of interdependence of function performed by these devices, module or unit.
It is noted that referred in the disclosure "one", the modification of " multiple " be schematically and not restrictive this field It will be appreciated by the skilled person that being otherwise construed as " one or more " unless clearly indicate otherwise in context.
The being merely to illustrate property of title of the message or information that are interacted between multiple devices in disclosure embodiment Purpose, and be not used to limit the range of these message or information.
The alternative embodiment of the disclosure is described in detail with reference to the accompanying drawing.
To the first embodiment that the disclosure provides, i.e., a kind of embodiment for the method for realizing front end applications.
The embodiment of the present disclosure is described in detail below with reference to Fig. 1, wherein Fig. 1 is the reality that the embodiment of the present disclosure provides The flow chart of the method for existing front end applications.
The embodiment of the present disclosure is applied to front end.
Front end, i.e. website front end part operate in PC end, and user's browsing is presented on the browsers such as mobile terminal Webpage.
Step S101 is generated according to the text file of interface description language and configuration file and is called class libraries.
Interface description language (full name in English Interface description language, abbreviation IDL), is for retouching State a kind of computer language of component software interface.IDL describes interface by way of a kind of neutrality, so that in different platform The object of upper operation can be in communication with each other with the program write with different language and exchange.For example, a component is write as with C++, separately One component is write as with Java, carries out data communication by IDL between two components.
IDL is commonly used in far call software.In this case, different operation is usually called by remote client terminal Subject component in system, and these subject components may be to be write by different computer languages.IDL establishes two The bridge communicated between different operating system.
The text file of the interface description language is the file that can be opened and edit by text editor, therefore, It is simple with exploitation, readable strong advantage.
For example, Thrift IDL is exactly a kind of interface description language unrelated with programming language, developer is allowed to connect with one kind The mode closely programmed describes and defining interface;Thrift IDL is simple for structure, semantic clear;The type that Thrift IDL is defined Relatively the data type in existing various programming languages, learning cost are lower;Thrift idl file can be used directly To generate calling class libraries, promotion development efficiency;But Thrift IDL is for describing remote procedure call (full name in English Remote Procedure Call, abbreviation RPC) interface, description HTTP interface can not be used directly to.
The above-mentioned advantage of embodiment of the present disclosure combination IDL, with application programming interfaces (full name in English Application Programming Interface, abbreviation API) relevant information writes in the annotation of IDL, is extended to IDL.Developer The text file that interface description language can be read directly acquires specific meaning of the IDL data type in request message.
API is some functions predetermined, or refers to the agreement of software systems difference component part linking.Purpose be soft Part developer provides a kind of common software or hardware of accessing without accessing true form or understanding the details of internal work mechanism Ability.API has the function of data input and data output.
The calling class libraries includes multiple calling classes, and each calling class includes the calling function of multiple encapsulation.The tune It include into ginseng and going out to join with the parameter of function.It is described enter ginseng be call when be passed to it is described call function data;It is described go out ginseng be Call the information returned after the application programming interfaces service of rear end.
For example, a service in the text file of interface description language corresponds to the class called in class libraries, clothes An application programming interfaces in business correspond to a calling function in class.
Call function default that " fetch API " format is used to send request message in the embodiments of the present disclosure.
Meanwhile calling function described in the embodiment of the present disclosure further includes customized request transmission interface, calls function can be with Customized request transmission interface is called to send request message.
Customized request transmission interface can generate customized in calling function according to the configuration information in configuration file Request transmission interface.
The customized request transmission interface, comprising: call entry parameter.
The call entry parameter includes at least the string argument of uniform resource locator.
Optionally, the call entry parameter further includes request type parameter and/or any type parameter.
For example, call entry parameter meets format:
(url:string, init: RequestInit, opts: any),
Wherein,
Comprising 3 parameters, first parameter url is uniform resource locator, must be filled out, type string;
Second parameter init for request type parameter, choosing is filled out, type RequestInit;
Third parameter opts for any type parameter, choosing is filled out, and can be any type.
Since the format of call entry parameter and the parameter format of " fetch API " are almost the same, so calling class libraries can To be easily compatible with two kinds of functions.Scheme is efficiently solved to which the scene for some specially treateds provides one kind.
Configuration file, including for example generating for handling the configuration information for generating some special circumstances when calling class libraries The information of customized request transmission interface, filters out preset field.It include: JSON file, YAML file and/or JS file.
Optionally, described generated according to the text file and configuration file of interface description language calls class libraries, including following Step:
Step S101-1, acquisition meets the first of Interface Expanding definition rule and connects from the text file of interface description language Mouth description information and the first annotation information.
The text file of interface description language, comprising: first interface description information and the first annotation information.
For example, first interface description information is Thrift IDL, the first annotation information is the application program with calling rear end The relevant information of interface service, such as HTTP information, for calling HTTP interface, the first annotation information is written to the annotation of IDL In, IDL is extended.
The Interface Expanding definition rule, defines the first annotation information, and define first interface description information with The relationship and description method of first annotation information.
Such as: the Interface Expanding definition rule, the expression formula of the extension information including the first annotation information:
Fer.<key>=<' value'>;
Wherein,
Fer indicates the initiation feature mark for meeting the extension information of the first annotation information of Interface Expanding definition rule;
=, front and back is with or without space;
<key>indicates extension information;
<' value'>, indicate the value of extension information.
Step S101-2 explains the first interface description information and described first according to the Interface Expanding definition rule The relationship of annotation information, generative grammar logic tree.
Namely extension information is explained by resolver according to the Interface Expanding definition rule.For example, continue above-mentioned example, First annotation information is information relevant to HTTP, and the mode which writes annotation the inside is extended Thrift IDL, The relationship of Thrift IDL and annotation information are explained by resolver in compiling;On the one hand, extension information is read for developer , tell specific meaning of the corresponding Thrift type of developer in HTTP request;On the other hand, extension information is for parsing What device was explained, determine corresponding Thrift type in the implementation of generation called in class libraries.
Grammer logic tree is a kind of abstract representation of source code syntax structure;It is with tree-shaped form performance programming language Syntactic structure, each node on tree indicate one of source code structure;The grammer can't represent true grammer Each details of middle appearance;For example, nested parenthesis is implied in the structure of tree, there is no presented in the form of node;And class It is similar to conditional jump sentence as if-condition-then, band can be used, and there are two the nodes of branch to indicate.Example Such as, grammer logic tree refers to abstract syntax tree (full name in English Abstract Syntax Tree, abbreviation AST).
Step S101-3 parses the configuration file according to preset configuration rule and obtains configuration information and configuration structure.
Since configuration information is recorded in configuration file according to configuration structure, if to identify the configuration in configuration file Information then needs to parse the configuration file according to preset configuration rule.
The configuration structure is a kind of hierarchical structure.
Step S101-4 generates the calling based on the grammer logic tree, the configuration information and the configuration structure Class libraries.
Optionally, the configuration structure is hierarchical structure corresponding with the grammer logic tree.
For example, configuration structure are as follows:
| -- global configuration mark
| -- global configuration content
| -- file configuration mark
| -- file path
| -- configuration mark in file
| -- content is configured in file
| -- service configuration mark
| -- service name
| -- configuration mark in service
| -- content is configured in service
| -- interface configuration mark
| -- interface name
| -- interface configures content
The configuration structure and grammer logic tree can form mapping relations.
Optionally, described that the calling is generated based on the grammer logic tree, the configuration information and the configuration structure Class libraries, comprising the following steps:
Step S101-4-11 obtains the first corresponding relationship of the grammer logic tree Yu the configuration structure.
The configuration information is mapped to the grammer logic tree according to first corresponding relationship by step S101-4-12 In, and generate the calling class libraries.
Calling class libraries includes that JavaScript (abbreviation JS) type calls class libraries and TypeScript (abbreviation TS) type to call class Library is respectively suitable for JS projects and TS projects.;It is called in class libraries in TS type, each container type, such as The message in struct and Protocol Buffers in Thrift, can generate a corresponding interface;For Realize that the namespace in the text file of interface description language, the calling class libraries of TS class libraries type use following formats:
"import*as<ns>from<file>";
Wherein,
<file>refers to the text file of the interface description language of dependence;
<ns>indicates the namespace title if the file relied on;
If namesapce title includes point number, point number can be converted to underscore, the place of corresponding type reference Corresponding conversion can be done.
Step S102, based on the application programming interfaces service for calling function call rear end.
Website backstage technology or dynamic website technology are also, for dynamically changing the content in front end page in rear end With some code logics of realization.For example, the registration login authentication of user or shopping clearing etc..Common website rear end exploitation Language has asp, asp.net, jsp, php etc..Website backstage technology further includes database simultaneously, for storing back-end data.
The application programming interfaces service of rear end is a pre-defined function for receiving to call and automatically generate return information Service.For example, the service of the HTTP interface of rear end.
The application programming interfaces service based on the calling function call rear end, comprising:
Step S102-1, the configuration information acquisition request message based on the calling function and the configuration file.
The request message includes request header information and request body information.
When running the calling function, function is called to automatically generate request message.
Request header information includes the information and information associated with request body information of communications protocol.For example, HTTP's asks Ask message request header information include: protocol type, target domain name and port, source domain name and port, uniform resource identifier, can Receive data type, compress mode, language, connection type.
Request body information includes the request content that requesting party sends.
Function is called to generate corresponding request message according to preset protocol type.For example, preset protocol type is HTTP class Type, then request message is the message generated according to http protocol.
Data are transmitted in a network, and data volume is bigger, and the speed for handling data is slower.In order to reduce the data of data transmission Amount usually needs to carry out serializing processing to the body information (i.e. request body information) in message before transmitting message.At serializing Reason is exactly that character information is converted into the process of byte stream.
In the embodiment of the present disclosure, optionally, the configuration information includes serializing processing information.
The configuration information acquisition request message based on the calling function and the configuration file, comprising:
Step S102-1-1 obtains the configuration information.
Step S102-1-2 judges whether the configuration information includes serializing processing letter corresponding with the calling function Breath.
Step S102-1-3, if so, being based on the calling function and institute's configuration information acquisition request message, wherein institute Request body information is stated to handle by serializing.
For example, configuration information instruction generates HTTP request message, then request message is generated according to HTTP, and show to request Body information is handled without serializing;Called application programming interfaces are HTTP interface.
For example, configuration information instruction generates Thrift or Protocol Buffers request message, then according to Thrift or Protocol Buffers generates request message, and shows to carry out serializing processing to request body information;Called application journey Sequence interface is RPC interface.
Step S102-2 calls the application programming interfaces service of rear end according to the request message.
Optionally, after the application programming interfaces service for calling rear end according to the request message, further includes:
Step S102-3 is obtained and is handled request response associated with the request message.
Request response is the response message that backend applications interface is returned according to request message.In general, request is rung Answering message includes request head response information and request response body information.
It requests to ring the information and information associated with request response body that head information includes communications protocol.For example, HTTP The request head response information of request response includes: protocol type, response time, control cache way, byte traffic identifier, pressure Contracting mode and connection type.
Request response body information includes the response contents that responder sends.
Specifically includes the following steps:
Step S102-3-1 obtains the request response that the application programming interfaces return.
Step S102-3-2 obtains the configuration information.
When the request body information of request message has carried out serializing processing, then the request of the request response returned responds Body information also carries out unserializing processing.
Step S102-3-3 judges whether the configuration information includes serializing processing letter corresponding with the calling function Breath.
Step S102-3-4, if so, carrying out unserializing processing to request response body information, and according to default sound Body rule information and the request response body acquisition of information is answered to go out the value joined.
Unserializing processing is exactly that byte stream is converted into the process of character information.So that the byte being difficult to is circulated Change the identifiable character information of user into.Namely text information.
Due to including much information in request response body information, including the value for going out ginseng.It is transmitted in order to facilitate communication, It needs that much information is organized into request response body information by default response body rule information.
The request is decomposed according to default response body rule information and responds body information, so as to obtain out the value joined.
The embodiment of the present disclosure automatically generates calling class libraries by the text file and configuration file of interface description language, reduces The workload of developer.The HTTP request message for calling class libraries default sending application in extensive range of generation.And the calling generated Class libraries is small in size, meets front end to the high request of code cubage.Scene suitable for Web, WebView and small routine.
Corresponding with the first embodiment that the disclosure provides, the disclosure additionally provides second embodiment, i.e., before a kind of realization Hold the device of application.Since second embodiment is substantially similar to first embodiment, so describe fairly simple, relevant part Refer to the corresponding explanation of first embodiment.Installation practice described below is only schematical.
Fig. 2 shows a kind of embodiments for device for realizing front end applications that the disclosure provides.Fig. 2 is the embodiment of the present disclosure The unit block diagram of the device of the realization front end applications of offer.
Shown in Figure 2, the disclosure provides a kind of device for realizing front end applications, comprising: generates and calls class library unit 201, call unit 202.
It generates and calls class library unit 201, called for being generated according to the text file and configuration file of interface description language Class libraries;Wherein, the calling class libraries includes multiple calling classes, and each calling class includes the calling function of multiple encapsulation;
Call unit 202 calls answering for rear end for the configuration information based on the calling function and the configuration file It is serviced with routine interface.
Optionally, it is called in class library unit 201 in the generation, comprising:
Text information subelement is obtained, meets Interface Expanding definition for obtaining from the text file of interface description language The first interface description information and the first annotation information of rule;
Generative grammar logic tree subelement, for explaining that the first interface describes according to the Interface Expanding definition rule The relationship of information and first annotation information, generative grammar logic tree;
Parse configuration file subelement, for according to preset configuration rule parse the configuration file obtain configuration information and Configuration structure;
It generates and calls class libraries subelement, for being based on the grammer logic tree, the configuration information and the configuration structure Generate the calling class libraries.
Optionally, it is called in class libraries subelement in the generation, comprising:
The first corresponding relationship subelement is obtained, first for obtaining the grammer logic tree and the configuration structure is corresponding Relationship;
Subelement is mapped, for the configuration information to be mapped to the grammer logic tree according to first corresponding relationship In, and generate the calling class libraries.
Optionally, in call unit 202, further includes:
Acquisition request message subelement is asked for the configuration information acquisition based on the calling function and the configuration file Seek message;The request message includes request header information and request body information;
Request message calls subelement, for calling the application programming interfaces service of rear end according to the request message.
Optionally, the configuration information includes serializing processing information corresponding with the calling function;
In the acquisition request message subelement, comprising:
First obtains configuration information subelement, for obtaining the configuration information;
First judgement serializing subelement, for judging whether the configuration information includes corresponding with the calling function Serializing processing information;
Serializing processing subelement, if for described first judge serializing identify subelement output result for "Yes", Then it is based on the calling function and institute's configuration information acquisition request message, wherein the request body information is handled by serializing.
Optionally, in said device, further includes:
Response unit, for obtaining and handling request response associated with the request message.
In the response unit, comprising:
Acquisition request response message subelement, the request response returned for obtaining the application programming interfaces;Institute Stating request response includes request head response information and request response body information;
Second obtains configuration information subelement, for obtaining the configuration information;
Second judgement serializing subelement, for judging whether the configuration information includes corresponding with the calling function Serializing processing information;
Unserializing handles subelement, if the output result for the second judgement serializing mark subelement is "Yes" then carries out unserializing processing to request response body information, and according to default response body rule information and described asks Response body acquisition of information is asked to go out the value joined.
Optionally, the calling function further includes customized request transmission interface;The customized request transmission interface packet Include call entry parameter;
The call entry parameter includes at least the string argument of uniform resource locator;
And/or
The call entry parameter further includes request type parameter and/or any type parameter.
The embodiment of the present disclosure automatically generates calling class libraries by the text file and configuration file of interface description language, reduces The workload of developer.The HTTP request message for calling class libraries default sending application in extensive range of generation.And the calling generated Class libraries is small in size, meets front end to the high request of code cubage.Scene suitable for Web, WebView and small routine.
The embodiment of the present disclosure provides 3rd embodiment, i.e. a kind of electronic equipment, and the equipment is for realizing front end applications Method, the electronic equipment, comprising: at least one processor;And the storage being connect at least one described processor communication Device;Wherein,
The memory is stored with the instruction that can be executed by one processor, and described instruction is by described at least one It manages device to execute, so that at least one described processor is able to carry out the method for realizing front end applications as in the first embodiment.
The embodiment of the present disclosure provides fourth embodiment, i.e., a kind of computer storage medium for realizing front end applications, described Computer storage medium is stored with computer executable instructions, and the computer executable instructions are executable such as institute in first embodiment State the method for realizing front end applications.
Below with reference to Fig. 3, it illustrates the structural schematic diagrams for the electronic equipment for being suitable for being used to realize the embodiment of the present disclosure.This Terminal device in open embodiment can include but is not limited to such as mobile phone, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable media player), car-mounted terminal (such as vehicle mounted guidance Terminal) etc. mobile terminal and such as number TV, desktop computer etc. fixed terminal.Electronic equipment shown in Fig. 3 An only example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
As shown in figure 3, electronic equipment may include processing unit (such as central processing unit, graphics processor etc.) 301, Random access storage device can be loaded into according to the program being stored in read-only memory (ROM) 302 or from storage device 308 (RAM) program in 303 and execute various movements appropriate and processing.In RAM 303, it is also stored with electronic device institute The various programs and data needed.Processing unit 301, ROM 302 and RAM 303 are connected with each other by bus 304.Input/defeated (I/O) interface 305 is also connected to bus 304 out.
In general, following device can connect to I/O interface 305: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 306 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 307 of dynamic device etc.;Storage device 308 including such as tape, hard disk etc.;And communication device 309.Communication device 309, which can permit electronic equipment, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 3, which is shown, to be had respectively The electronic equipment of kind device, it should be understood that being not required for implementing or having all devices shown.It can be alternatively real Apply or have more or fewer devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising being carried on non-transient computer can The computer program on medium is read, which includes the program code for method shown in execution flow chart.At this In the embodiment of sample, which can be downloaded and installed from network by communication device 309, or be filled from storage It sets 308 to be mounted, or is mounted from ROM 302.When the computer program is executed by processing unit 301, the disclosure is executed The above-mentioned function of being limited in the method for embodiment.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In open, computer-readable signal media may include in a base band or as the data-signal that carrier wave a part is propagated, In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable and deposit Any computer-readable medium other than storage media, the computer-readable signal media can send, propagate or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. are above-mentioned Any appropriate combination.
In some embodiments, client, server can use such as HTTP (HyperText Transfer Protocol, hypertext transfer protocol) etc the network protocols of any currently known or following research and development communicated, and can To be interconnected with the digital data communications (for example, communication network) of arbitrary form or medium.The example of communication network includes local area network (" LAN "), wide area network (" WAN "), Internet (for example, internet) and ad-hoc network are (for example, the end-to-end net of ad hoc Network) and any currently known or following research and development network.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity When sub- equipment executes, so that the electronic equipment: obtaining at least two internet protocol addresses;Send to Node evaluation equipment includes institute State the Node evaluation request of at least two internet protocol addresses, wherein the Node evaluation equipment is internet from described at least two In protocol address, chooses internet protocol address and return;Receive the internet protocol address that the Node evaluation equipment returns;Its In, the fringe node in acquired internet protocol address instruction content distributing network.
Alternatively, above-mentioned computer-readable medium carries one or more program, when said one or multiple programs When being executed by the electronic equipment, so that the electronic equipment: receiving the Node evaluation including at least two internet protocol addresses and request; From at least two internet protocol address, internet protocol address is chosen;Return to the internet protocol address selected;Wherein, The fringe node in internet protocol address instruction content distributing network received.
The calculating of the operation for executing the disclosure can be write with one or more programming languages or combinations thereof Machine program code, above procedure design language include but is not limited to object oriented program language-such as Java, Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet It includes local area network (LAN) or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as benefit It is connected with ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard The mode of part is realized.Wherein, the title of unit does not constitute the restriction to the unit itself under certain conditions, for example, the One acquiring unit is also described as " obtaining the unit of at least two internet protocol addresses ".
Function described herein can be executed at least partly by one or more hardware logic components.Example Such as, without limitation, the hardware logic component for the exemplary type that can be used include: field programmable gate array (FPGA), specially With integrated circuit (ASIC), Application Specific Standard Product (ASSP), system on chip (SOC), complex programmable logic equipment (CPLD) etc. Deng.
In the context of the disclosure, machine readable media can be tangible medium, may include or is stored for The program that instruction execution system, device or equipment are used or is used in combination with instruction execution system, device or equipment.Machine can Reading medium can be machine-readable signal medium or machine-readable storage medium.Machine readable media can include but is not limited to electricity Son, magnetic, optical, electromagnetism, infrared or semiconductor system, device or equipment or above content any conjunction Suitable combination.The more specific example of machine readable storage medium will include the electrical connection of line based on one or more, portable meter Calculation machine disk, hard disk, random access memory (RAM), read-only memory (ROM), Erasable Programmable Read Only Memory EPROM (EPROM Or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage facilities or Any appropriate combination of above content.
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that the open scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from design disclosed above, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure Can technical characteristic replaced mutually and the technical solution that is formed.
Although this is not construed as requiring these operations with institute in addition, depicting each operation using certain order The certain order that shows executes in sequential order to execute.Under certain environment, multitask and parallel processing may be advantageous 's.Similarly, although containing several specific implementation details in being discussed above, these are not construed as to this public affairs The limitation for the range opened.Certain features described in the context of individual embodiment can also be realized in combination single real It applies in example.On the contrary, the various features described in the context of single embodiment can also be individually or with any suitable The mode of sub-portfolio is realized in various embodiments.
Although having used specific to this theme of the language description of structure feature and/or method logical action, answer When understanding that theme defined in the appended claims is not necessarily limited to special characteristic described above or movement.On on the contrary, Special characteristic described in face and movement are only to realize the exemplary forms of claims.

Claims (10)

1. a kind of method for realizing front end applications characterized by comprising
It is generated according to the text file of interface description language and configuration file and calls class libraries;Wherein, the calling class libraries includes more A calling class, each calling class include the calling function of multiple encapsulation;
The application programming interfaces service of rear end is called based on the configuration information of the calling function and the configuration file.
2. the method according to claim 1, wherein the text file and configuration according to interface description language File generated calls class libraries, comprising:
The first interface description information and for meeting Interface Expanding definition rule is obtained from the text file of interface description language One annotation information;
The relationship of the first interface description information Yu first annotation information is explained according to the Interface Expanding definition rule, Generative grammar logic tree;
The configuration file, which is parsed, according to preset configuration rule obtains configuration information and configuration structure;
The calling class libraries is generated based on the grammer logic tree, the configuration information and the configuration structure.
3. according to the method described in claim 2, it is characterized in that, described be based on the grammer logic tree, the configuration information The calling class libraries is generated with the configuration structure, comprising:
Obtain the first corresponding relationship of the grammer logic tree Yu the configuration structure;
The configuration information is mapped in the grammer logic tree according to first corresponding relationship, and generates the calling class Library.
4. according to the method described in claim 2, it is characterized in that, described based on the calling function and the configuration file The application programming interfaces service of configuration information calling rear end, comprising:
Based on the configuration information acquisition request message for calling function and the configuration file;The request message includes request Head information and request body information;
The application programming interfaces service of rear end is called according to the request message.
5. according to the method described in claim 4, it is characterized in that, the configuration information includes corresponding with the calling function Serializing processing information;
The configuration information acquisition request message based on the calling function and the configuration file, comprising:
Obtain the configuration information;
Judge whether the configuration information includes serializing processing information corresponding with the calling function;
If so, being based on the calling function and institute's configuration information acquisition request message, wherein the request body information passes through sequence Columnization processing.
6. according to the method described in claim 4, it is characterized in that, in the application for calling rear end according to the request message After routine interface service, further includes:
Obtain the request response that the application programming interfaces return;The request response includes request head response information Body information is responded with request;
Obtain the configuration information;
Judge whether the configuration information includes serializing processing information corresponding with the calling function;
If so, carrying out unserializing processing to request response body information, and according to default response body rule information and institute It states request response body acquisition of information and goes out the value joined.
7. the method according to claim 1, wherein the calling function further includes that customized request transmission connects Mouthful;The customized request transmission interface includes call entry parameter;
The call entry parameter includes at least the string argument of uniform resource locator;
And/or
The call entry parameter further includes request type parameter and/or any type parameter.
8. a kind of device for realizing front end applications characterized by comprising
It generates and calls class library unit, call class libraries for generating according to the text file and configuration file of interface description language;Its In, the calling class libraries includes multiple calling classes, and each calling class includes the calling function of multiple encapsulation;
Call unit calls the application program of rear end to connect for the configuration information based on the calling function and the configuration file Oral business.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is by processor The method as described in any one of claims 1 to 7 is realized when execution.
10. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs, when one or more of programs are by one or more of processing When device executes, so that one or more of processors realize the method as described in any one of claims 1 to 7.
CN201910715754.8A 2019-08-05 2019-08-05 Method, device, medium and equipment for realizing front-end application Active CN110457144B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910715754.8A CN110457144B (en) 2019-08-05 2019-08-05 Method, device, medium and equipment for realizing front-end application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910715754.8A CN110457144B (en) 2019-08-05 2019-08-05 Method, device, medium and equipment for realizing front-end application

Publications (2)

Publication Number Publication Date
CN110457144A true CN110457144A (en) 2019-11-15
CN110457144B CN110457144B (en) 2021-12-07

Family

ID=68484732

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910715754.8A Active CN110457144B (en) 2019-08-05 2019-08-05 Method, device, medium and equipment for realizing front-end application

Country Status (1)

Country Link
CN (1) CN110457144B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124541A (en) * 2019-12-25 2020-05-08 上海米哈游网络科技股份有限公司 Configuration file generation method, device, equipment and medium
CN111309304A (en) * 2020-02-11 2020-06-19 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating IDL file
CN111309375A (en) * 2020-02-11 2020-06-19 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating remote procedure call toolkit
CN111324342A (en) * 2020-02-10 2020-06-23 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating interface layer code
CN111338813A (en) * 2020-02-10 2020-06-26 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for dynamically generating middleware
CN111414161A (en) * 2020-03-27 2020-07-14 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating ID L file
CN111767035A (en) * 2020-06-22 2020-10-13 星辰天合(北京)数据科技有限公司 Application interface docking method and device based on OpenAPI
CN114553966A (en) * 2022-01-21 2022-05-27 山东浪潮通软信息科技有限公司 Front-end Http request construction method, device, equipment and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104009994A (en) * 2014-05-30 2014-08-27 北京京东尚科信息技术有限公司 Method and device for achieving communication of server side and client side
CN106648940A (en) * 2017-03-13 2017-05-10 北京百悟科技有限公司 Remote procedure call method and device
CN107301098A (en) * 2017-06-15 2017-10-27 搜易贷(北京)金融信息服务有限公司 A kind of remote procedure call device based on Thrift agreements, method and system
CN108038796A (en) * 2017-12-11 2018-05-15 厦门亿力吉奥信息科技有限公司 GIS service operation method, storage medium based on C++
CN109714332A (en) * 2018-12-26 2019-05-03 北京字节跳动网络技术有限公司 The method for converting protocol and device parsed based on Thrift and syntax tree
CN110069259A (en) * 2019-03-04 2019-07-30 北京三快在线科技有限公司 Analytic method, device, electronic equipment and storage medium based on idl file

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104009994A (en) * 2014-05-30 2014-08-27 北京京东尚科信息技术有限公司 Method and device for achieving communication of server side and client side
CN106648940A (en) * 2017-03-13 2017-05-10 北京百悟科技有限公司 Remote procedure call method and device
CN107301098A (en) * 2017-06-15 2017-10-27 搜易贷(北京)金融信息服务有限公司 A kind of remote procedure call device based on Thrift agreements, method and system
CN108038796A (en) * 2017-12-11 2018-05-15 厦门亿力吉奥信息科技有限公司 GIS service operation method, storage medium based on C++
CN109714332A (en) * 2018-12-26 2019-05-03 北京字节跳动网络技术有限公司 The method for converting protocol and device parsed based on Thrift and syntax tree
CN110069259A (en) * 2019-03-04 2019-07-30 北京三快在线科技有限公司 Analytic method, device, electronic equipment and storage medium based on idl file

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124541A (en) * 2019-12-25 2020-05-08 上海米哈游网络科技股份有限公司 Configuration file generation method, device, equipment and medium
CN111124541B (en) * 2019-12-25 2023-09-08 上海米哈游网络科技股份有限公司 Configuration file generation method, device, equipment and medium
CN111324342A (en) * 2020-02-10 2020-06-23 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating interface layer code
CN111338813A (en) * 2020-02-10 2020-06-26 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for dynamically generating middleware
CN111338813B (en) * 2020-02-10 2023-05-12 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for dynamically generating middleware
CN111324342B (en) * 2020-02-10 2023-04-07 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating interface layer code
CN111309304A (en) * 2020-02-11 2020-06-19 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating IDL file
CN111309375A (en) * 2020-02-11 2020-06-19 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating remote procedure call toolkit
CN111309375B (en) * 2020-02-11 2023-07-04 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating remote procedure call toolkit
CN111414161B (en) * 2020-03-27 2023-05-12 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating IDL file
CN111414161A (en) * 2020-03-27 2020-07-14 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating ID L file
CN111767035A (en) * 2020-06-22 2020-10-13 星辰天合(北京)数据科技有限公司 Application interface docking method and device based on OpenAPI
CN114553966A (en) * 2022-01-21 2022-05-27 山东浪潮通软信息科技有限公司 Front-end Http request construction method, device, equipment and medium

Also Published As

Publication number Publication date
CN110457144B (en) 2021-12-07

Similar Documents

Publication Publication Date Title
CN110457144A (en) A kind of method, apparatus that realizing front end applications, medium and equipment
US8656417B2 (en) Interface for telecommunication services using uniform resource identifiers
CN110489323A (en) Visual RPC API adjustment method, device, medium and equipment
CN110489101A (en) Interface analogy method, system, medium and electronic equipment
US7904111B2 (en) Mobile exchange infrastructure
CN101405761B (en) For service reception and the method and system processing data
CN108494860A (en) WEB accesses system, WEB access methods and device for client
CN109714332A (en) The method for converting protocol and device parsed based on Thrift and syntax tree
CN109062563A (en) Method and apparatus for generating the page
CN111930534A (en) Data calling method and device and electronic equipment
US20200111487A1 (en) Voice capable api gateway
CN110069308A (en) The page starts method, apparatus, electronic equipment and storage medium
CN110209315A (en) The display methods of character, device, electronic equipment and storage medium in user interface
CN110704200A (en) Method and device for converting call interface
CN110377273A (en) A kind of method, apparatus of data processing, medium and electronic equipment
CN112243016B (en) Middleware platform, terminal equipment, 5G artificial intelligence cloud processing system and processing method
CN110489474A (en) A kind of method, apparatus of data processing, medium and electronic equipment
Yellavula Hands-On RESTful Web Services with Go: Develop Elegant RESTful APIs with Golang for Microservices and the Cloud
CN115145574A (en) Code generation method and device, storage medium and server
CN114500481A (en) Service request processing method, system and device
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN109981546A (en) The method and apparatus for obtaining the far call relationship between application module
CN104980511B (en) A kind of game data access method, system and game web page server
CN115509647B (en) API (application program interface) access method, conversion method, device, equipment and storage medium
CN110489326A (en) HTTPAPI adjustment method device, medium and equipment based on IDS

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
CP01 Change in the name or title of a patent holder

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.

CP01 Change in the name or title of a patent holder