CN110099122A - Method and apparatus for sending network request - Google Patents

Method and apparatus for sending network request Download PDF

Info

Publication number
CN110099122A
CN110099122A CN201910377417.2A CN201910377417A CN110099122A CN 110099122 A CN110099122 A CN 110099122A CN 201910377417 A CN201910377417 A CN 201910377417A CN 110099122 A CN110099122 A CN 110099122A
Authority
CN
China
Prior art keywords
network request
class
request
network
sending
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
CN201910377417.2A
Other languages
Chinese (zh)
Other versions
CN110099122B (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 CN201910377417.2A priority Critical patent/CN110099122B/en
Publication of CN110099122A publication Critical patent/CN110099122A/en
Application granted granted Critical
Publication of CN110099122B publication Critical patent/CN110099122B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Telephonic Communication Services (AREA)

Abstract

Embodiment of the disclosure discloses the method and apparatus for sending network request.One specific embodiment of this method, which comprises determining whether to detect, is used to indicate the user's request for sending target network request, wherein target network request belongs to preset network request collection;In response to confirmly detecting user's request, determine class belonging to the object of target network request to be sent, wherein, identified class follows network request agreement or network request interface, wherein, the method that network request agreement or network request interface are used to be packaged for sending the network request that network request is concentrated;Call its corresponding for sending the method for target network request to send target network request by identified class.The embodiment helps to promote the convenience for sending network request.

Description

Method and apparatus for sending network request
Technical field
Embodiment of the disclosure is related to field of computer technology, and in particular to for sending the method and dress of network request It sets.
Background technique
Generally, various client applications or mobile terminal application etc. be all based on internet communication, that is, require with Server interaction.When client application or mobile terminal are applied without connection network, generally can only be to local data at Reason.
And during being interacted with server, provided function or clothes are applied according to client application or mobile terminal The difference of business, each client application or mobile terminal application may relate to many kinds of network requests.Different types of network is asked Usually there are also differences between asking.
Summary of the invention
Embodiment of the disclosure proposes the method and apparatus for sending network request.
In a first aspect, embodiment of the disclosure provides a kind of method for sending network request, this method comprises: really Fixed whether detect is used to indicate the user's request for sending target network request, wherein target network request belongs to preset net Network request collection;In response to confirmly detecting user's request, class belonging to the object of target network request to be sent is determined, wherein Identified class follows network request agreement or network request interface, wherein network request agreement or network request interface are used for The method for being packaged for sending the network request that network request is concentrated;Call its corresponding for sending mesh by identified class The method of network request is marked to send target network request.
In some embodiments, network request collection includes being used to indicate the network request interacted with server-side.
In some embodiments, it then follows network request agreement or the class of network request interface include first object class and second Target class, wherein first object class realizes that is encapsulated in network request agreement or network request interface is used to send network request Method be for sending the network request that interacts with server-side of instruction, the second target class realization network request agreement or network are asked Seeking the method for sending network request encapsulated in interface is the network request interacted for sending instruction with target database.
In some embodiments, target database includes local data base.
Second aspect, embodiment of the disclosure provide a kind of for sending the device of network request, which includes: use Determination unit is requested at family, is configured to determine and whether is detected that being used to indicate the user for sending target network request requests, wherein Target network request belongs to preset network request collection;Class determination unit is configured in response to confirmly detect user's request, Determine class belonging to the object of target network request to be sent, wherein identified class follows network request agreement or network is asked Seek interface, wherein network request agreement or network request interface are used to be packaged for send the network request that network request is concentrated Method;Transmission unit, the method for being configured to call its corresponding by identified class for sending target network request To send target network request.
In some embodiments, network request collection includes being used to indicate the network request interacted with server-side.
In some embodiments, it then follows network request agreement or the class of network request interface include first object class and second Target class, wherein first object class realizes that is encapsulated in network request agreement or network request interface is used to send network request Method be for sending the network request that interacts with server-side of instruction, the second target class realization network request agreement or network are asked Seeking the method for sending network request encapsulated in interface is the network request interacted for sending instruction with target database.
In some embodiments, target database includes local data base.
The third aspect, embodiment of the disclosure provide a kind of terminal, which includes: one or more processors;It deposits Storage device, for storing one or more programs;When one or more programs are executed by one or more processors, so that one Or multiple processors realize the method as described in implementation any in first aspect.
Fourth aspect, embodiment of the disclosure provide a kind of computer-readable medium, are stored thereon with computer program, The method as described in implementation any in first aspect is realized when the computer program is executed by processor.
The method and apparatus for sending network request that embodiment of the disclosure provides, by by different types of network General some methods for sending network request of request are packaged into agreement or interface, then by needing to send network request Different scenes corresponding to class all follow packaged agreement or interface so that needing to send the different fields of network request Class corresponding to scape all necessarily realizes the method that network request is sent defined in packaged agreement or interface.Therefore, exist Specifically need to send under the scene of network request, can the class as belonging to the object of network request to be sent call directly transmission The method of network request, so that it may realize the transmission of network request.
Corresponding network request is all preset respectively with the scene in the prior art for every kind of transmission network request Class, and the method for defining by corresponding network request class the transmission network request under different scenes is compared, due in the prior art This mode under the scene for specifically needing to send network request, belonging to the object that needs first to judge network request to be sent Class, and then class belonging to the object of network request to be sent could be instantiated, the corresponding network request class of a step of going forward side by side In transmission network request method to send network request.
And method provided by embodiment of the disclosure is by allowing under different scenes the class for needing to send network request all to be abided by The agreement or interface for encapsulating general some methods for being used to send network request of different types of network request are followed, thus The class for needing to send network request under different scenes is allowed to call directly the corresponding method for sending network request to send Network request.Compared to the prior art, it does not need all to preset respectively for the scene of every kind of transmission network request corresponding Network request class first judges network request to be sent to also not need under the scene for specifically needing to send network request Object belonging to class.The workload of technical staff is not only alleviated, but also helps to promote the speed for sending network request.
In addition, above-mentioned mode in the prior art is more and more with the scene for needing to send network request, corresponding hair The processing logic of SCN Space Cable Network request can also become increasingly complex naturally.For example, judging class belonging to the object of network request to be sent This logic judgment process will with the increase for the scene for needing to send network request even more complex.Accordingly, this is patrolled It is naturally also longer to collect deterministic process the time it takes.And handle logic it is excessively complicated when, developer's also error-prone, The problems such as so as to cause application crashes.It is avoided by method described in embodiment of the disclosure due to excessive logic judgment And it is easy to appear the situation of mistake, it ensure that the stability of network request.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the disclosure is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the disclosure can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for sending network request of the disclosure;
Fig. 3 is according to an embodiment of the present disclosure for sending the signal of an application scenarios of the method for network request Figure;
Fig. 4 is the structural schematic diagram according to one embodiment of the device for sending network request of the disclosure;
Fig. 5 is adapted for the structural schematic diagram for realizing the electronic equipment of embodiment of the disclosure.
Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the disclosure can phase Mutually combination.The disclosure is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can the method for sending network request using the disclosure or the dress for sending network request The exemplary architecture 100 for the embodiment set.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105. Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
Terminal device 101,102,103 is interacted by network 104 with server 105, to receive or send message etc..Terminal Various client applications can be installed in equipment 101,102,103.For example, the application of browser class, searching class application, Instant Messenger Believe class application, the application of content share class etc..
Terminal device 101,102,103 can be hardware, be also possible to software.When terminal device 101,102,103 is hard When part, it can be various electronic equipments, including but not limited to smart phone, tablet computer, E-book reader, on knee portable Computer and desktop computer etc..When terminal device 101,102,103 is software, above-mentioned cited electricity may be mounted at In sub- equipment.Multiple softwares or software module may be implemented into (such as providing multiple softwares of Distributed Services or soft in it Part module), single software or software module also may be implemented into.It is not specifically limited herein.
Server 105 can be to provide the server of various services, for example, be installed on terminal device 101,102,103 Application provide support back-end server.Server 105 can receive various nets transmitted by terminal device 101,102,103 Network request, and according to the received network request of institute, corresponding response message is returned to terminal device.
It should be noted that is installed on above-mentioned terminal device 101,102,103 exists using transmitted network request Under some cases, response processing directly can also be carried out from the local of terminal device 101,102,103.At this point it is possible to be not present Server 105 and network 104.
It should be noted that the method provided by embodiment of the disclosure for sending network request is generally set by terminal Standby 101,102,103 execute, and correspondingly, the device for sending network request is generally positioned at terminal device 101,102,103 In.
It should be noted that server 105 can be hardware, it is also possible to software.It, can when server 105 is hardware To be implemented as the distributed server cluster that multiple servers form, individual server also may be implemented into.When server 105 is When software, multiple softwares or software module may be implemented into (such as providing multiple softwares of Distributed Services or software mould Block), single software or software module also may be implemented into.It is not specifically limited herein.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, it illustrates according to one embodiment of the method for sending network request of the disclosure Process 200.This be used for send network request method the following steps are included:
Step 201, it is determined whether detect and be used to indicate the user's request for sending target network request.
In the present embodiment, for send network request executing subject (terminal device as shown in Figure 1 101,102, 103) it can detecte and be used to indicate the user's request for sending network request.Wherein, under different application scenarios, user's request can To trigger by various modes.
For example, user's request can be triggered by user's operation.As an example, user is utilizing above-mentioned executing subject When browsing pushed information, it can be triggered by refresh operation (such as sliding page clicks refresh button) to server (such as Fig. 1 Shown in server 105) send the network request for obtaining new pushed information.
For example, user's request can also be according to preset some condition automatic triggers.As an example, in user to current exhibition The page shown does not have any operation more than after certain time, can trigger the net for sending to server and obtaining new displaying information Network request.
Wherein, network request can be various network requests.Such as the network request for obtaining data, for uploading number According to network request etc..The indicated network request of user's request is target network request.
Wherein, target network request may belong to preset network request collection.Network request collection can be pre- by technical staff First according to actual application demand flexible setting.Network request collection may include that the various scenes for needing to send network request are corresponding Network request.
Step 202, in response to confirmly detecting user's request, belonging to the object for determining target network request to be sent Class, wherein identified class follows network request agreement or network request interface.
In the present embodiment, it needs to send target network request, is necessarily required to specifically send the object of network request.Generally Ground can determine the object of target network request to be sent according to the specific request content that target network is requested, and then can root According to class belonging to the identified object acquisition object.
For example, target network request is used for the new displaying information of request current page, then target network to be sent The main body of network request should be object (or example) example of class corresponding to current page.In another example target network is requested The new page for requesting to open, then the main body of target network to be sent request should be that requested new page institute is right The object for the class answered.
Wherein, the class of target network request to be sent can follow network request agreement or network request interface.Wherein, net Network request protocol or network request interface can be used for being packaged for the method for sending the network request that network request is concentrated.
Network request agreement or network request interface can be preset to be packaged for sending what network request was concentrated The method of various network requests.Specifically, it can be asked according to the network that network request corresponding under different scenes is concentrated It asks, extracts the certain methods of some general (or public) of these network requests, and the reality by way of agreement or interface It is existing.
Later, so that it may allow and need to send class corresponding to the various scenes of network request and follow the above-mentioned net realized in advance Network request protocol or network request interface.Needing to send class corresponding to the various scenes of network request in turn can be respectively at it The universal method extracted in network request agreement or network request interface is implemented in class.
It should be noted that the network request under different exploitation environment and different development languages, for encapsulation The specific implementation form of method can be different.For example, under some development languages agreement (Protocol) can be passed through To encapsulate certain methods.Under some development languages, certain methods can be encapsulated by interface (Interface).
Step 203, call its corresponding for sending the method for target network request to send mesh by identified class Mark network request.
In the present embodiment, identified class can directly be utilized to call its corresponding for sending target network request Method, when being executed, identified class will call the method for sending target network request that it is implemented naturally, from And realize the transmission of target network request.
Optionally, it then follows network request agreement or the class of network request interface directly can call its specific implementation using class Network request agreement or network request interface defined in method, without being called by example.
In some optional implementations of the present embodiment, network request collection may include being used to indicate to hand over server-side Mutual network request.Generally, the network request of many transmissions is all sent to server-side, can also further receive later Server-side is directed to the response message for receiving network request.
For example, being used to indicate the network request interacted with server-side may include being used to indicate from server-side to obtain data Network request.As an example, network request may include being used to indicate the network request for obtaining comment information from server-side.Network Request also may include being used to indicate the network request that newest pushed information is obtained from server-side.
In some optional implementations of the present embodiment, network request collection may include being used to indicate and target data The network request of library interaction.Wherein, target database can refer to the database connecting with above-mentioned executing subject.
For example, being used to indicate the network request interacted with target database may include being used to indicate from target database to obtain Access evidence.As an example, the data of the network request institute request sent are stored in target database.
In some optional implementations of the present embodiment, target database may include local data base.Some In the case of, data be that can store in the local of above-mentioned executing subject.For example, above-mentioned executing subject can locally be installed There is local data base.In another example above-mentioned executing subject has some data in local cache in some cases.
In some optional implementations of the present embodiment, it then follows network request agreement or the class of network request interface can To include first object class and the second target class.Wherein, network request agreement may be implemented in first object class or network request connects The method for sending network request encapsulated in mouthful is the network request interacted for sending instruction with server-side.Second target Class realizes that the method for sending network request encapsulated in network request agreement or network request interface is to indicate for sending The network request interacted with target database.Wherein, target database can refer to the database connecting with above-mentioned executing subject.It can Selection of land, target database can be local data base.
Wherein, the corresponding class of different scenes for needing to send network request can follow network request agreement or network is asked Seek interface.At this time, it then follows network request agreement or the class of network request interface require to realize that network request agreement or network are asked The method for sending network request encapsulated in interface is sought, but can be different in specific implementation.For example, some classes can To be implemented as the network request interacted for sending instruction with server-side, some classes can be implemented as referring to for sending Show the network request interacted with target database.
For example, being packaged with the method for the new displaying information of request in network request agreement or network request interface.Have The class for following network request agreement or network request interface can implement the side of the new displaying information of this request Method is the method that request obtains new displaying information from server-side.And some follows network request agreement or network request interface The method that class can implement the new displaying information of this request is that request obtains new displaying letter from local data base The method of breath.
The Public method that request is sent under different scenes is extracted by network request agreement or network request interface, by following Network request agreement or the class of network request interface go to implement corresponding method according to its corresponding application scenarios, further Promote the convenience for sending network request.
It is one of the application scenarios of the method according to the present embodiment for sending network request with continued reference to Fig. 3, Fig. 3 Schematic diagram 300.In the application scenarios of Fig. 3, terminal device 301 is detecting that user clicks " adding of showing on video page Carry more " button when, i.e. triggering sends network request to obtain more videos.
Since network request to be sent is used to obtain more videos that the current video page is shown, it is to be sent The object of network request is the corresponding object of the current video page.The relevant treatment logic of video page is by the video write in advance Class realizes that the relevant treatment logic of articles page is realized by the article class 303 write in advance.And video class and article class are all abided by Follow the network request agreement 304 write in advance.Wherein, video page and articles page can be encapsulated in network request agreement 304 The universal method of the various network requests sent, and have in network request agreement 304 in video class 302 and article class 303 and seal The specific implementation of each method of dress.
For example, the method for the more page presentation information of request can be packaged in network request agreement 304, it is right Ying Di can implement the method for the more page presentation information of request to obtain more multi-page in video class 302 Show video.It is more to obtain that the method for the more page presentation information of request can be implemented in article class 303 Page presentation article.
Later, the network request for the more videos of request of loading can be called directly by the corresponding video class of video page Method sends network request to realize to server 305.Later, server 305 can be according to the network request received, to end End equipment 301 returns to more videos to be presented.
The method provided by the above embodiment of the disclosure is by the way that the general of different types of network request some to be used for The method for sending network request is packaged into agreement or interface, then the class as corresponding to the different scenes for needing to send network request Packaged agreement or interface are all followed, so that it is all inevitable real to need to send class corresponding to the different scenes of network request The method that network request is sent defined in packaged agreement or interface is showed.Therefore, it needs to send network specifically and asks Under the scene asked, can the class as belonging to the object of network request to be sent call directly send network request method, so that it may To realize the transmission of network request, help to promote the convenience for sending network request.
With further reference to Fig. 4, as the realization to method shown in above-mentioned each figure, present disclose provides ask for sending network The one embodiment 400 for the device asked, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically may be used To be applied in various electronic equipments.
As shown in figure 4, the device 400 provided in this embodiment for sending network request includes that user requests determination unit 401, class determination unit 402 and transmission unit 403.
In the present embodiment, in the device 400 for sending network request: it is single that user requests determination unit 401, class to determine The specific processing of member 402 and transmission unit 403 and its brought technical effect can be respectively with reference to the steps in Fig. 2 corresponding embodiment Rapid 401, the related description of step 402 and step 403, details are not described herein.
In some optional implementations of the present embodiment, network request collection includes being used to indicate to interact with server-side Network request.
In some optional implementations of the present embodiment, it then follows the class packet of network request agreement or network request interface Include first object class and the second target class, wherein first object class is realized to be encapsulated in network request agreement or network request interface The method for sending network request be for sending the network request that interacts with server-side of instruction, the second target class realization net The method for sending network request encapsulated in network request protocol or network request interface is for sending instruction and number of targets According to the network request of library interaction.
In some optional implementations of the present embodiment, target database includes local data base.
The device provided by the above embodiment of the disclosure requests determination unit 401 to determine whether to detect use by user User's request of target network request is sent in instruction, wherein target network request belongs to preset network request collection;Class determines Unit 402 determines class belonging to the object of target network request to be sent, wherein institute in response to confirmly detecting user's request Determining class follows network request agreement or network request interface, wherein network request agreement or network request interface are for sealing The method for filling the network request for sending network request concentration;Transmission unit 403 calls its corresponding by identified class For sending the method for target network request to send target network request, the convenient of network request is sent to help to be promoted Property.
Below with reference to Fig. 5, it illustrates the electronic equipment that is suitable for being used to realize embodiment of the disclosure, (example is as shown in figure 1 Terminal device) 500 structural schematic diagram.Terminal device in embodiment of the disclosure can include but is not limited to such as move electricity Words, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable multimedia Player), the mobile terminal and such as number TV, desktop computer etc. of car-mounted terminal (such as vehicle mounted guidance terminal) etc. Fixed terminal.Terminal device shown in Fig. 5 is only an example, function to embodiment of the disclosure and should not use model Shroud carrys out any restrictions.
As shown in figure 5, electronic equipment 500 may include processing unit (such as central processing unit, graphics processor etc.) 501, random access can be loaded into according to the program being stored in read-only memory (ROM) 502 or from storage device 508 Program in memory (RAM) 503 and execute various movements appropriate and processing.In RAM 503, it is also stored with electronic equipment Various programs and data needed for 500 operations.Processing unit 501, ROM 502 and RAM503 are connected with each other by bus 504. Input/output (I/O) interface 505 is also connected to bus 504.
In general, following device can connect to I/O interface 505: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 506 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 507 of dynamic device etc.;Storage device 508 including such as tape, hard disk etc.;And communication device 509.Communication device 509, which can permit electronic equipment 500, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 5 shows tool There is the electronic equipment 500 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with Alternatively implement or have more or fewer devices.Each box shown in Fig. 5 can represent a device, can also root According to needing to represent multiple 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 be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 509, or from storage device 508 It is mounted, or is mounted from ROM 502.When the computer program is executed by processing unit 501, the implementation of the disclosure is executed The above-mentioned function of being limited in the method for example.
It is situated between it should be noted that computer-readable medium described in embodiment of the disclosure can be computer-readable signal Matter or computer readable storage medium either the two any combination.Computer readable storage medium for example can be with System, device or the device of --- but being not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or it is any more than Combination.The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires Electrical connection, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type are programmable Read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic are deposited Memory device or above-mentioned any appropriate combination.In embodiment of the disclosure, computer readable storage medium, which can be, appoints What include or the tangible medium of storage program that the program can be commanded execution system, device or device use or and its It is used in combination.And in embodiment of the disclosure, computer-readable signal media may include in a base band or as carrier wave The data-signal that a part is propagated, wherein carrying computer-readable program code.The data-signal of this propagation can be adopted With diversified forms, including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal is situated between Matter can also be any computer-readable medium other than computer readable storage medium, which can be with It sends, propagate or transmits for by the use of instruction execution system, device or device or program in connection.Meter The program code for including on calculation machine readable medium can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. or above-mentioned any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned terminal;It is also possible to individualism, and it is unassembled Enter in the terminal.Above-mentioned computer-readable medium carries one or more program, when said one or multiple program quilts When the terminal executes, so that the terminal: determine whether to detect that being used to indicate the user for sending target network request requests, In, target network request belongs to preset network request collection;In response to confirmly detecting user's request, target network to be sent is determined Class belonging to the object of network request, wherein identified class follows network request agreement or network request interface, wherein network The method that request protocol or network request interface are used to be packaged for sending the network request that network request is concentrated;By being determined Class call its it is corresponding for send target network request method with send target network request.
The behaviour for executing embodiment of the disclosure can be write with one or more programming languages or combinations thereof The computer program code of work, described program design language include 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 Include local area network (LAN) or wide area network (WAN) --- it is connected to subscriber computer, or, it may be connected to outer computer (such as It is connected using 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 embodiment of the disclosure can be realized by way of software, can also be passed through The mode of hardware is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor Determination unit, class determination unit and transmission unit are requested including user.Wherein, the title of these units is not under certain conditions The restriction to the unit itself is constituted, for example, user requests determination unit to be also described as " determining whether to detect and being used for It indicates to send the unit that the user of target network request requests ".
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 it should be appreciated that embodiment of the disclosure involved in invention scope, however it is not limited to the specific combination of above-mentioned technical characteristic and At technical solution, while should also cover do not depart from foregoing invention design in the case where, by above-mentioned technical characteristic or its be equal Feature carries out any combination and other technical solutions for being formed.Such as disclosed in features described above and embodiment of the disclosure (but It is not limited to) technical characteristic with similar functions is replaced mutually and the technical solution that is formed.

Claims (10)

1. a kind of method for sending network request, comprising:
Determine whether to detect and be used to indicate the user's request for sending target network request, wherein the target network request belongs to In preset network request collection;
It is requested in response to confirmly detecting the user, determines class belonging to the object of the target network request to be sent, In, identified class follows network request agreement or network request interface, wherein the network request agreement or the network are asked Seek method of the interface for being packaged for sending the network request that the network request is concentrated;
Call its corresponding for sending the method for the target network request to send the target network by identified class Network request.
2. according to the method described in claim 1, wherein, the network request collection includes being used to indicate the net interacted with server-side Network request.
3. according to the method described in claim 1, wherein, it then follows the class of the network request agreement or the network request interface Including first object class and the second target class, wherein the first object class realizes the network request agreement or the network The method for sending network request encapsulated in request interface is the network request interacted for sending instruction with server-side, institute It states the second target class and realizes that is encapsulated in the network request agreement or the network request interface is used to send network request Method is the network request interacted for sending instruction with target database.
4. according to the method described in claim 3, wherein, the target database includes local data base.
5. a kind of for sending the device of network request, comprising:
User requests determination unit, is configured to determine and whether detects that being used to indicate the user for sending target network request asks It asks, wherein the target network request belongs to preset network request collection;
Class determination unit is configured in response to confirmly detect user's request, determines that the target network to be sent is asked Class belonging to the object asked, wherein identified class follows network request agreement or network request interface, wherein the network The method that request protocol or the network request interface are used to be packaged for sending the network request that the network request is concentrated;
Transmission unit is configured to call its corresponding by identified class the method for sending the target network request To send the target network request.
6. device according to claim 5, wherein the network request collection includes being used to indicate the net interacted with server-side Network request.
7. device according to claim 5, wherein follow the class of the network request agreement or the network request interface Including first object class and the second target class, wherein the first object class realizes the network request agreement or the network The method for sending network request encapsulated in request interface is the network request interacted for sending instruction with server-side, institute It states the second target class and realizes that is encapsulated in the network request agreement or the network request interface is used to send network request Method is the network request interacted for sending instruction with target database.
8. device according to claim 7, wherein the target database includes local data base.
9. a kind of terminal, comprising:
One or more processors;
Storage device is stored thereon with one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now method as described in any in claim 1-4.
10. a kind of computer-readable medium, is stored thereon with computer program, wherein the realization when program is executed by processor Method as described in any in claim 1-4.
CN201910377417.2A 2019-05-07 2019-05-07 Method and apparatus for sending network request Active CN110099122B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910377417.2A CN110099122B (en) 2019-05-07 2019-05-07 Method and apparatus for sending network request

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910377417.2A CN110099122B (en) 2019-05-07 2019-05-07 Method and apparatus for sending network request

Publications (2)

Publication Number Publication Date
CN110099122A true CN110099122A (en) 2019-08-06
CN110099122B CN110099122B (en) 2020-05-15

Family

ID=67447205

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910377417.2A Active CN110099122B (en) 2019-05-07 2019-05-07 Method and apparatus for sending network request

Country Status (1)

Country Link
CN (1) CN110099122B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150058469A1 (en) * 2013-08-20 2015-02-26 Futurewei Technologies, Inc. Monitoring NAT Behaviors Through URI Dereferences in Web Browsers
CN106412009A (en) * 2016-08-29 2017-02-15 郑州悉知信息科技股份有限公司 Interface calling method and device
US20170078160A1 (en) * 2015-09-16 2017-03-16 Samsung Electronics Co., Ltd Method for processing services and electronic device for the same
CN107438097A (en) * 2017-06-26 2017-12-05 北京五八信息技术有限公司 Network request processing method and processing device
CN107948135A (en) * 2017-10-31 2018-04-20 贵州白山云科技有限公司 A kind of data processing method and device for supporting a variety of API protocols
CN108287706A (en) * 2017-05-10 2018-07-17 腾讯科技(深圳)有限公司 Data processing method and device
CN109614102A (en) * 2018-10-09 2019-04-12 平安科技(深圳)有限公司 Code automatic generation method, device, electronic equipment and storage medium
CN109635019A (en) * 2018-10-23 2019-04-16 平安科技(深圳)有限公司 Request processing method, device, equipment and storage medium
CN109802996A (en) * 2018-12-14 2019-05-24 平安科技(深圳)有限公司 Send method, apparatus, computer equipment and the storage medium of network request

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150058469A1 (en) * 2013-08-20 2015-02-26 Futurewei Technologies, Inc. Monitoring NAT Behaviors Through URI Dereferences in Web Browsers
US20170078160A1 (en) * 2015-09-16 2017-03-16 Samsung Electronics Co., Ltd Method for processing services and electronic device for the same
CN106412009A (en) * 2016-08-29 2017-02-15 郑州悉知信息科技股份有限公司 Interface calling method and device
CN108287706A (en) * 2017-05-10 2018-07-17 腾讯科技(深圳)有限公司 Data processing method and device
CN107438097A (en) * 2017-06-26 2017-12-05 北京五八信息技术有限公司 Network request processing method and processing device
CN107948135A (en) * 2017-10-31 2018-04-20 贵州白山云科技有限公司 A kind of data processing method and device for supporting a variety of API protocols
CN109614102A (en) * 2018-10-09 2019-04-12 平安科技(深圳)有限公司 Code automatic generation method, device, electronic equipment and storage medium
CN109635019A (en) * 2018-10-23 2019-04-16 平安科技(深圳)有限公司 Request processing method, device, equipment and storage medium
CN109802996A (en) * 2018-12-14 2019-05-24 平安科技(深圳)有限公司 Send method, apparatus, computer equipment and the storage medium of network request

Also Published As

Publication number Publication date
CN110099122B (en) 2020-05-15

Similar Documents

Publication Publication Date Title
EP3910909A1 (en) Method and device for displaying information
CN109992732A (en) Information sharing method, device, electronic equipment and storage medium
CN110213614A (en) The method and apparatus of key frame are extracted from video file
CN109558323A (en) For debugging system, the method and apparatus of the page
US20220342925A1 (en) Material presentation method, electronic device, and storage medium
CN110098998A (en) Method and apparatus for handling information
CN109525855A (en) Method and apparatus for handling information
CN110334246A (en) A kind of data request processing method, apparatus, terminal device and storage medium
CN109753332A (en) Method and apparatus for showing information
CN111597466A (en) Display method and device and electronic equipment
CN110619100A (en) Method and apparatus for acquiring data
CN108334516A (en) Information-pushing method and device
CN110618768B (en) Information presentation method and device
CN110377273A (en) A kind of method, apparatus of data processing, medium and electronic equipment
CN109885593A (en) Method and apparatus for handling information
CN111813685B (en) Automatic test method and device
WO2020221090A1 (en) Method for use in combined operation of guest applications, and device
CN109150928A (en) Method and apparatus for handling request
CN108052377B (en) Cloud-based input processing method and device, server and storage medium
CN109582580A (en) For debugging system, the method and apparatus of the page
CN110099122A (en) Method and apparatus for sending network request
CN114417214A (en) Information display method and device and electronic equipment
CN111327472B (en) Method and device for acquiring target network
CN114035787A (en) Webpage construction method and device, electronic equipment, storage medium and product
CN110147368A (en) Data capture method and device for server

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
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.