CN107301053A - Picture collocation method, device and electric terminal - Google Patents

Picture collocation method, device and electric terminal Download PDF

Info

Publication number
CN107301053A
CN107301053A CN201710536090.XA CN201710536090A CN107301053A CN 107301053 A CN107301053 A CN 107301053A CN 201710536090 A CN201710536090 A CN 201710536090A CN 107301053 A CN107301053 A CN 107301053A
Authority
CN
China
Prior art keywords
network
function
picture
request
network request
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
CN201710536090.XA
Other languages
Chinese (zh)
Other versions
CN107301053B (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710536090.XA priority Critical patent/CN107301053B/en
Publication of CN107301053A publication Critical patent/CN107301053A/en
Application granted granted Critical
Publication of CN107301053B publication Critical patent/CN107301053B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the present invention provides a kind of picture collocation method, device and electric terminal, and starting up's function that this method is included in electric terminal is initialized when starting to picture configuration function;Response user's picture configuration-direct simultaneously calls class function in picture configuration function;Call the primary network station in class function to ask function, and ask the picture defined in function to load call function according to primary network station and two grade network request function is called;The first network request tool-class in function is asked to call three-level network to ask function to initiate network request according to two grade network;Judge whether by the parameter value that three-level network asks function to be adjusted back when initiating network request be preset value, if so, then network request success, and the parameter value of readjustment is preserved to two grade network request function;Picture URL in parameter value downloads corresponding network picture and is shown and preserves.The present invention can effectively improve the real-time in network picture configuration process, reduce network traffics and waste.

Description

Picture collocation method, device and electric terminal
Technical field
The present invention relates to Internet application and development technical field, in particular to a kind of picture collocation method, device and Electric terminal.
Background technology
Through inventor study find, existing electric terminal in use still there are problems, for example, with Family carry out virtual present give or picture browsing etc. during, general using two kinds of picture configuration modes, one kind is to believe picture Breath is directly stored in progress picture in local file and called, still, and such a configuration mode can cause in application redaction hair every time During cloth, the problems such as picture for early version occur can not be changed;Another downloaded in real time by connecting network, but such is matched somebody with somebody Mode is put network connection is smooth or occurs that flow wastes and can not realize the problems such as picture is configured during failure, therefore, such as What realizes the real-time that both can guarantee that in network piece configuration process, and avoid flow to waste again turns into those skilled in the art's Study hotspot.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of picture collocation method, device and electric terminal, can effectively improve guarantor The real-time in picture configuration process is demonstrate,proved, avoids network traffics from wasting again, is effectively improved customer experience.
Present pre-ferred embodiments provide a kind of picture collocation method, applied to electric terminal, including:
Picture configuration function is initialized when starting up's function of the electric terminal starts;
Response user's picture configuration-direct simultaneously calls class function in the picture configuration function, wherein, the class function In include statement file to network picture requesting method;
Call the primary network station in the class function to ask function, and asked according to the primary network station defined in function Picture loads call function and two grade network request function is called;
According to the two grade network ask function in first network request tool-class call three-level network ask function with Initiate network request;
Judge whether by the parameter value that the three-level network asks function to be adjusted back when initiating network request be predetermined threshold value, If so, then network request success, and the parameter value of readjustment is preserved into two grade network request function;
Picture URL in the parameter value downloads corresponding network picture and is shown and preserves.
In the selection of present pre-ferred embodiments, methods described also includes:
If the parameter value of the readjustment is not predetermined threshold value, judge to ask function to initiate network by the three-level network Whether the request number of times of request is more than preset times;
If the request number of times is more than preset times, stop initiating network request, and load the two grade network request The web-based history picture preserved in function to map network position is shown;
If the request number of times is less than or equal to preset times, cause three-level network request function according to it is default when Between interval repeat to initiate network request, and whether for the parameter value adjusted back every time, it is the predetermined threshold value to judge it.
In the selection of present pre-ferred embodiments, the parameter value includes error code and the number of request obtained from backstage According to the predetermined threshold value includes preset value and preset data type, and the judgement asks function to be initiated by the three-level network Whether the parameter value adjusted back during network request is preset value, if so, the then successful step of network request, including:
Whether judge the error code is whether the data type of preset value and the request data is preset data class Type;
If the error code is preset value, and the data type of the request data is preset data type, then network please Hope for success work(.
In the selection of present pre-ferred embodiments, the implementation process of the three-level network request function includes following step Suddenly:
According to user profile generate splicing character string, and use predetermined encryption algorithm that the splicing character string is encrypted with Obtain encrypted characters string;
The encrypted characters string is spliced to the URL of basic network to obtain network URL;
Choose network request type and the second network request tool-class is created according to the network request type;
The singleton in the second network request tool-class is obtained, network is initiated by the singleton and the network URL Request, and judge whether the network request succeeds according to the parameter value of readjustment.
In the selection of present pre-ferred embodiments, the predetermined encryption algorithm is rivest, shamir, adelman.
Present pre-ferred embodiments also provide a kind of picture configuration device, applied to electric terminal, including:
Initialization module, for being carried out just to picture configuration function when starting up's function of the electric terminal starts Beginningization;
First calling module, for responding user's picture configuration-direct and calling class letter in the picture configuration function Number, wherein, the statement file to network picture requesting method is included in the class function;
Second calling module, for calling the primary network station in the class function to ask function, and according to the one-level net Picture loading call function defined in network request function is called to two grade network request function;
3rd calling module, for being asked the first network request tool-class in function to call three according to the two grade network Level network request function is to initiate network request;
Judge module, for judging to ask the parameter value adjusted back during function initiation network request to be by the three-level network No is predetermined threshold value, if so, then network request success, and the parameter value of readjustment is preserved to two grade network request function In;
Download module, downloads corresponding picture for the picture URL in the parameter value and preserves.
In the selection of present pre-ferred embodiments, it is not pre- that the judge module, which is additionally operable in the parameter value of the readjustment, If during threshold value, judging whether be more than preset times by the request number of times that the three-level network asks function to initiate network request;
If the request number of times is more than preset times, stop initiating network request, and load the two grade network request The web-based history picture preserved in function to map network position is shown;
If the request number of times is less than or equal to preset times, cause three-level network request function according to it is default when Between interval repeat to initiate network request, and whether for the parameter value adjusted back every time, it is the predetermined threshold value to judge it.
In the selection of present pre-ferred embodiments, the 3rd calling module includes:
Ciphering unit, for generating splicing character string according to user profile, and using predetermined encryption algorithm to the splicing word Symbol string is encrypted to obtain encrypted characters string;
Concatenation unit, for the encrypted characters string to be spliced to the URL of basic network to obtain network URL;
Creating unit, for choosing network request type and creating the second network request instrument according to the network request type Class;
Network request unit, for obtaining the singleton in the second network request tool-class, passes through the singleton and institute State network URL and initiate network request, and judge whether the network request succeeds according to the parameter value of readjustment.
Present pre-ferred embodiments also provide a kind of electric terminal, the electric terminal include memory, processor and on Described picture configuration device is stated, the picture configuration device is installed on the memory and including one or more by described Manage the software function module that device is performed.
Present pre-ferred embodiments provide a kind of computer-readable recording medium, are stored thereon with computer program, described Computer program realizes the step in picture collocation method described above upon execution.
Compared with prior art, the present invention realizes the logic in picture configuration process by using multi-step function calling technology Layering, improves the reusability of code and calls convenience, at the same time, and the configuration of network picture can also be effectively ensured in the present invention During real-time, reduce network traffics waste.
Further, the present invention adds fault tolerant mechanism in picture configuration process, effectively increases the stability of interface.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be attached to what is used required in embodiment Figure is briefly described, it will be appreciated that the following drawings illustrate only certain embodiments of the present invention, therefore is not construed as pair The restriction of scope, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to this A little accompanying drawings obtain other related accompanying drawings.
Fig. 1 is the application scenarios schematic diagram of picture collocation method provided in an embodiment of the present invention and device.
Fig. 2 is the block diagram of server provided in an embodiment of the present invention.
Fig. 3 is the schematic flow sheet of picture collocation method provided in an embodiment of the present invention.
Fig. 4 is the sub-process schematic diagram of picture collocation method provided in an embodiment of the present invention.
Fig. 5 is the frame structure schematic diagram of picture configuration device provided in an embodiment of the present invention.
Fig. 6 is the frame structure schematic diagram of the 3rd calling module shown in Fig. 5.
Icon:10- servers;100- memories;200- processors;300- communication units;400- picture configuration devices; 402- initialization modules;The calling modules of 404- first;The calling modules of 406- second;The calling modules of 408- the 3rd;4080- encryptions are single Member;4082- concatenation units;4084- creating units;4086- network request units;410- judge modules;412- download modules; 20- networks;30- electric terminals.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is A part of embodiment of the present invention, rather than whole embodiments.The present invention implementation being generally described and illustrated herein in the accompanying drawings The component of example can be arranged and designed with a variety of configurations.
Therefore, the detailed description of embodiments of the invention below to providing in the accompanying drawings is not intended to limit claimed The scope of the present invention, but be merely representative of the present invention selected embodiment.Based on the embodiment in the present invention, this area is common The every other embodiment that technical staff is obtained under the premise of creative work is not made, belongs to the model that the present invention is protected Enclose.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain Xiang Yi It is defined in individual accompanying drawing, then it further need not be defined and explained in subsequent accompanying drawing.
As shown in figure 1, being the application scenarios schematic diagram of a kind of picture collocation method provided in an embodiment of the present invention and device. The application scenarios can include server 10, network 20 and electric terminal 30, wherein, electric terminal 30 can be multiple.It is described Server 10 can be communicated by network 20 with the electric terminal 30.
Alternatively, in the present embodiment, the server 10 may be, but not limited to, Web (website) server, data Server etc., can also be that computer, mobile internet surfing equipment (mobile Internet device, MID) etc. have processing function Electronic equipment.The electric terminal 30 may be, but not limited to, smart mobile phone, PC (personal computer, PC), tablet personal computer, personal digital assistant (personal digital assistant, PDA), mobile internet surfing equipment (mobile Internet device, MID) etc..The network 20 may be, but not limited to, cable network or wireless network.
Fig. 2 is please referred to, the server 10 can include memory 100, processor 200 and communication unit 300.Institute State memory 100, processor 200 and communication unit 300 to be directly or indirectly electrically connected with each other, to realize the biography of data Defeated or interaction.It is electrically connected with for example, these elements can be realized by one or more communication bus or signal wire each other.Deposit Be stored with the software function mould being stored in the form of software or firmware (firmware) in the memory 100 in reservoir 100 Block, the processor 200 is stored in by operation in software program and module in memory 100, such as embodiment of the present invention Picture configuration device 400, so as to perform various function application and data processing, that is, realize the picture in the embodiment of the present invention Collocation method.
Wherein, the memory 100 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only storage (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc..Wherein, memory 100 is used for storage program, and processor 200 is performed after execute instruction is received Described program.Further, the software program and module in above-mentioned memory 100 may also include operating system.It may include Various component softwares and/or drive for management system task (such as memory management, storage device control, power management) It is dynamic, and can mutually be communicated with various hardware or component software, so as to provide the running environment of other software component.
The processor 200 is probably a kind of IC chip, the disposal ability with signal.Above-mentioned processor 200 can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc..Can also be digital signal processor (DSP)), application specific integrated circuit (ASIC), scene Programmable gate array (FPGA) or other PLDs, discrete gate or transistor logic, discrete hardware group Part.It can realize or perform disclosed each method, step and the logic diagram in the embodiment of the present invention.General processor can be with It is microprocessor or any conventional processors etc..
The communication unit 300 is used for the communication set up by network 20 between the server 10 and external communications terminals Connection, realizes the transmitting-receiving operation of network signal and data message, and above-mentioned network signal may include wireless signal or wire signal.
It is appreciated that the structure shown in Fig. 2 be only signal, the server 10 may also include it is more more than shown in Fig. 2 or The less component of person, or with the configuration different from shown in Fig. 2.Each component shown in Fig. 2 can using hardware, software or It, which is combined, realizes.
Fig. 3 is please referred to, the embodiment of the present invention also provides a kind of picture collocation method that can be applied to electric terminal 30, Method and step defined in the relevant flow of methods described can be realized by the processor 200.Below by the tool shown in Fig. 3 Body flow is described in detail.
Step S402, is carried out initial when starting up's function of the electric terminal 30 starts to picture configuration function Change.
During actual implementation, the picture configuration function is stored in advance in the electric terminal 30, and in the electric terminal 30 are loaded and are initialized when being started by starting up's function.Wherein, starting up's function can pass through function " didFinishLaunchingWithOptions " is realized.
It should be noted that only in starting up, loading once, is just loaded the picture configuration function without often entering a page Once, so as to effective saving network flow expense.
Step S404, responds user's picture configuration-direct and calls class function in the picture configuration function, wherein, institute State the statement file included in class function to network picture requesting method.
Step S406, calls the primary network station in the class function to ask function, and according to the primary network station request letter Picture loading call function defined in number is called to two grade network request function.
In the present embodiment, after initialization to the picture configuration function is completed, when user needs access web page, And when needing load networks picture, the picture configuration-direct that can be sent by responding user carries out calling the picture to configure letter Primary network station request function in class function in number.Primary network station request function pre-defines and is stored in the class function In, the picture configuration-direct for being sent according to user calls two grade network to ask function, and primary network station request function is not Return value and corresponding parameter value are set.During actual implementation, the class function can be realized by function " DYLevelTool ", The primary network station request function can be realized by function " requestLevelImgList ".
Alternatively, also prestore the statement text that function is asked the primary network station in the statement file of the class function Part.
It should be noted that in the present embodiment, the primary network station request function setup is simple, is only adjusted for outer layer functions With.
Step S408, asks the first network request tool-class in function to call three-level network please according to the two grade network Find a function to initiate network request.
In the present embodiment, the two grade network request function is used for the independent processing for carrying out some service layers, for example, depositing Store up network picture.In addition, in the present embodiment, the first network in function need to be asked to ask instrument by the two grade network Class is realized to be called to three-level network request function.Three-level network request function can pass through function " getLevelImageList " is realized.
Further, as shown in figure 4, the realization of three-level network request function is crossed including following sub-step.
Sub-step S4080, splicing character string is generated according to user profile, and using predetermined encryption algorithm to the splicing character String is encrypted to obtain encrypted characters string.
Wherein, the user profile can include the pet name, current time and other letters related to the user of user Breath etc..In actual implementation process, when user sends picture configuration-direct, user profile can be turned according to preset rules Change, be spliced to form splicing character string.In addition, the predetermined encryption used when the splicing character string is encrypted is calculated Method may be, but not limited to, rivest, shamir, adelman.
Sub-step S4082, the encrypted characters string is spliced to the URL of basic network to obtain network URL.
, can be by the encrypted characters string to splice in the form of prefix to the URL of the basic network in the present embodiment.Should Note, the basic network can be network under development environment or apply the formal environments net under traffic-operating period Network.For example, when the basic network is the network under development environment, the URL of the basic network is under current development environment Network URL;When the basic network is formal environments network, the URL of the basic network is under current formal environments Network URL.
Sub-step S4084, chooses network request type and creates the second network request instrument according to the network request type Class.
Sub-step S4086, obtains the singleton in the second network request tool-class, passes through the singleton and the network URL initiates network request, and judges whether the network request succeeds according to the parameter value of readjustment.
In the present embodiment, the network request type in sub-step S4084 can be GET functions or POST functions, its In, the GET functions refer to from specified resource request data, and the resource that the POST functions are directed to specify is submitted and located The data of reason.During actual implementation, the picture configuration-direct that can be sent according to user chooses corresponding network request type, Jin Erchuan Build the second network tool class, finally obtain the singleton in the second network request tool-class, and by the singleton and The network URL initiates network request.During actual implementation, the second network request tool-class can pass through function " AFInstanceManager " is realized, and obtains singleton manager therein by function " sharedManager ".
Further, after the initiation of network request is completed, the three-level network request function can adjust back corresponding parameter Value, for example, the parameter value may be, but not limited to, following three kinds.
Parameter 1:ErrorCode asks the error code of function.
Parameter 2:ErrorMessage, asks the error message (network request failure) of function.
Parameter 3:The request data (network request success) that data is obtained from backstage.
It should be understood that when carrying out parameter value judgement, one kind or many in above-mentioned parameter value can be chosen according to actual conditions Kind.
Step S410, judge by the three-level network ask during function initiation network request the parameter value adjusted back whether be Predetermined threshold value, if so, step S412 is then performed, conversely, then performing step S416.
In the present embodiment, the parameter value can be the error code of above-mentioned request function and the number of request obtained from backstage According to the predetermined threshold value includes preset value corresponding with the error code, and preset data corresponding with the request data Type.
Step S412, network request success, and the parameter value of readjustment is preserved into two grade network request function.
Should be the preset value and institute in the error code when the parameter value to readjustment judges in the present embodiment The data type of request data is stated in the case of preset data type, just to can determine that network request success.
It should be noted that the request data of readjustment includes the URL of picture, therefore, can be by readjustment after network request success Parameter value is preserved into two grade network request function.
Step S414, the picture URL in the parameter value downloads corresponding network picture and is shown and preserves.
, can be by the network after the picture URL in callback data downloads corresponding network picture in the present embodiment Piece is preserved into two grade network request function, for when next network request fails, directly invoking this preservation Network picture improves Consumer's Experience.
Step S416, judges whether be more than in advance by the request number of times that the three-level network asks function to initiate network request If number of times, if so, step S418 is then performed, conversely, performing step S410.
Step S418, if the request number of times is more than preset times, stops initiating network request, and load described two grades The web-based history picture preserved in network request function to map network position is shown.
In the present embodiment, carry out initiation network request when be provided with fault tolerant mechanism improve the stability of network interface with And the successful probability of network request.In other words, can when the network request for asking function to be initiated by the three-level network fails The successful probability of stability and network request of network interface is improved by repeating to send identical network request.Specifically Ground, can judge whether request number of times is more than default by setting preset times and prefixed time interval, when network request fails Number of times come determine perform step S418 or step S410.Alternatively, the preset times and prefixed time interval can be according to reality Situation carries out flexible design, and the present embodiment is without limitation.
For example, when actually implementing, it is assumed that preset times are 5, prefixed time interval is 5 seconds, then, when request number of times is small When 5, the three-level network can be re-called in 5 seconds by the delay of function " dispatch_after " time-delay method Function " requestAnchorLevelImgList " is asked to initiate network request, while request number of times retrytimes is added 1, If when the request number of times is more than 5 times, the parameter value of readjustment is still different from the predetermined threshold value, i.e., can not obtain network Piece, then directly can be carried in corresponding network site by the last network picture being stored in the two grade network request function To show user, so as to improve Consumer's Experience.
It should be noted that the network request may be, but not limited to, the reason for failure network connection interruption or network signal compared with Difference etc..
Further, based on foregoing description, the embodiment of the present invention also provides a kind of computer-readable recording medium, deposits thereon Computer program is contained, computer program realizes each described in the corresponding embodiments of the method for above-mentioned Fig. 3 or Fig. 4 upon execution Step.
Fig. 5 is please referred to, the embodiment of the present invention also provides a kind of picture configuration that can be applied to the electric terminal 30 Device 400.The picture configuration device 400 include initialization module 402, the first calling module 404, the second calling module 406, 3rd calling module 408, judge module 410 and download module 412.
The initialization module 402, for being configured when starting up's function of the electric terminal 30 starts to picture Function is initialized.Specifically, in the present embodiment, the initialization module 402 can be used for performing the step in Fig. 3 S402, specific operating method refers to step S402 detailed description.
First calling module 404, for responding user's picture configuration-direct and calling in the picture configuration function Class function, wherein, the statement file to network picture requesting method is included in the class function.Specifically, in this implementation In example, first calling module 404 can be used for performing the step S404 in Fig. 3, and specific operating method refers to step S404 detailed description.
Second calling module 406, for calling the primary network station in the class function to ask function, and according to described Picture loading call function defined in primary network station request function is called to two grade network request function.Specifically, exist In the present embodiment, second calling module 406 can be used for performing the step S406 in Fig. 3, and specific operating method is referred to Step S406 detailed description.
3rd calling module 408, for being asked the first network in function to ask instrument according to the two grade network Class calls three-level network to ask function to initiate network request.Specifically, in the present embodiment, the 3rd calling module 408 Available for the step S408 performed in Fig. 3, specific operating method refers to step S408 detailed description.During actual implementation, As shown in fig. 6, the 3rd calling module 408 includes ciphering unit 4080, concatenation unit 4082, creating unit 4084 and network Request unit 4086.
Wherein, the ciphering unit 4080, for generating splicing character string according to user profile, and is calculated using predetermined encryption The splicing character string is encrypted to obtain encrypted characters string for method.Specifically, in the present embodiment, the ciphering unit 4080 Available for the step S4080 performed in Fig. 4, specific operating method refers to step S4080 detailed description.
The concatenation unit 4082, for the encrypted characters string to be spliced to the URL of basic network to obtain network URL.Specifically, in the present embodiment, the concatenation unit 4082 can be used for performing the step S4082 in Fig. 4, specific operation Method refers to step S4082 detailed description.
The creating unit 4084, for choosing network request type and creating the second network according to the network request type Ask tool-class.Specifically, in the present embodiment, the creating unit 4084 can be used for performing the step S4084 in Fig. 4, tool The operating method of body refers to step S4084 detailed description.
The network request unit 4086, for obtaining the singleton in the second network request tool-class, passes through the list Example and the network URL initiate network request, and judge whether the network request succeeds according to the parameter value of readjustment.Specifically Ground, in the present embodiment, the network request unit 4086 can be used for performing the step S4086 in Fig. 4, specific operating method Refer to step S4086 detailed description.
The judge module 410, for judging to ask what function was adjusted back when initiating network request by the three-level network Whether parameter value is predetermined threshold value, if so, then network request success, and by the parameter value of readjustment preserve to the two grade network please In finding a function.Specifically, in the present embodiment, the judge module 410 is available for the step S410, step performed in Fig. 3 S416 and step S418, specific operating method refers to step S410, step S416 or step S418 detailed description.
The download module 412, downloads corresponding network picture for the picture URL in the parameter value and protects Deposit.
Specifically, in the present embodiment, the download module 412 can be used for performing the step S412 in Fig. 3, specific behaviour Step S412 detailed description is referred to as method.
In summary, picture collocation method provided in an embodiment of the present invention, device and electric terminal 30, by using multistage Function call technology can realize the layering logic layers in picture configuration process, improve the reusability of code and call convenience, Meanwhile, the real-time in network picture configuration process can also be effectively ensured in the present invention, reduce network traffics and waste.
In addition, the present invention adds fault tolerant mechanism in picture configuration process, effectively increases the stability of interface, Consumer's Experience is improved, and this method is simple, strong applicability.
In the description of the invention, term " setting ", " connected ", " connection " should be interpreted broadly, for example, it may be fixed Connect or be detachably connected, or be integrally connected;Can be mechanical connection or electrical connection;Can be direct It is connected, can also be indirectly connected to by intermediary, can be the connection of two element internals.For the ordinary skill of this area For personnel, the concrete meaning of above-mentioned term in the present invention can be understood with concrete condition.
In several embodiments that the embodiment of the present invention is provided, it should be understood that disclosed apparatus and method, also may be used To realize by other means.Apparatus and method embodiment described above is only schematical, for example, the stream in accompanying drawing Journey figure and block diagram show that the device of the predetermined number embodiment according to the present invention, method and computer program product may be real Existing architectural framework, function and operation.At this point, each square frame in flow chart or block diagram can represent module, a journey A part for sequence section or code.A part for the module, program segment or code is used to realize comprising one or predetermined number Defined logic function.
It should also be noted that in some implementations as replacement, the function of being marked in square frame can also be with difference The order marked in accompanying drawing occurs.For example, two continuous square frames can essentially be performed substantially in parallel, they are sometimes It can also perform in the opposite order, this is depending on involved function.It is also noted that in block diagram and/or flow chart The combination of each square frame and the square frame in block diagram and/or flow chart, can be with function as defined in performing or action it is special Hardware based system is realized, or can be realized with the combination of specialized hardware and computer instruction.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies Change, equivalent substitution, improvement etc., should be included in the scope of the protection.

Claims (10)

1. a kind of picture collocation method, applied to electric terminal, it is characterised in that including:
Picture configuration function is initialized when starting up's function of the electric terminal starts;
Response user's picture configuration-direct simultaneously calls class function in the picture configuration function, wherein, wrapped in the class function Contain the statement file to network picture requesting method;
Call the primary network station in the class function to ask function, and the picture defined in function is asked according to the primary network station Loading call function is called to two grade network request function;
The first network request tool-class in function is asked to call three-level network to ask function to be initiated according to the two grade network Network request;
Judge whether by the parameter value that the three-level network asks function to be adjusted back when initiating network request be predetermined threshold value, if It is, then network request success, and the parameter value of readjustment is preserved into two grade network request function;
Picture URL in the parameter value downloads corresponding network picture and is shown and preserves.
2. picture collocation method according to claim 1, it is characterised in that methods described also includes:
If the parameter value of the readjustment is not predetermined threshold value, judge to ask function to initiate network request by the three-level network Request number of times whether be more than preset times;
If the request number of times is more than preset times, stop initiating network request, and load the two grade network request function The web-based history picture of middle preservation to map network position is shown;
If the request number of times is less than or equal to preset times, the three-level network is caused to ask function according between preset time Whether every repeating initiation network request, and the parameter value for adjusting back every time, it is the predetermined threshold value to judge it.
3. picture collocation method according to claim 1, it is characterised in that the parameter value includes error code and from backstage The request data of acquisition, the predetermined threshold value includes preset value and preset data type, and the judgement passes through the three-level network Whether the parameter value that request function initiates to adjust back during network request is preset value, if so, the then successful step of network request, bag Include:
Whether judge the error code is whether the data type of preset value and the request data is preset data type;
If the error code be preset value, and the request data data type be preset data type, then network request into Work(.
4. picture collocation method according to claim 1, it is characterised in that the three-level network asks the realization of function Journey comprises the following steps:
Splicing character string is generated according to user profile, and uses predetermined encryption algorithm that the splicing character string is encrypted to obtain Encrypted characters string;
The encrypted characters string is spliced to the URL of basic network to obtain network URL;
Choose network request type and the second network request tool-class is created according to the network request type;
The singleton in the second network request tool-class is obtained, network request is initiated by the singleton and the network URL, And judge whether the network request succeeds according to the parameter value of readjustment.
5. picture collocation method according to claim 4, it is characterised in that the predetermined encryption algorithm is asymmetric encryption Algorithm.
6. a kind of picture configuration device, applied to electric terminal, it is characterised in that including:
Initialization module, it is initial for being carried out when starting up's function of the electric terminal starts to picture configuration function Change;
First calling module, for responding user's picture configuration-direct and calling class function in the picture configuration function, its In, the statement file to network picture requesting method is included in the class function;
Second calling module, for calling the primary network station in the class function to ask function, and please according to the primary network station Picture loading call function defined in finding a function is called to two grade network request function;
3rd calling module, for being asked the first network request tool-class in function to call three-level net according to the two grade network Network asks function to initiate network request;
Judge module, for judge by the three-level network ask during function initiation network request the parameter value adjusted back whether be Predetermined threshold value, if so, then network request success, and the parameter value of readjustment is preserved into two grade network request function;
Download module, downloads corresponding picture for the picture URL in the parameter value and preserves.
7. picture configuration device according to claim 6, it is characterised in that the judge module is additionally operable in the readjustment Parameter value not be predetermined threshold value when, judge by the three-level network ask function initiation network request request number of times whether More than preset times;
If the request number of times is more than preset times, stop initiating network request, and load the two grade network request function The web-based history picture of middle preservation to map network position is shown;
If the request number of times is less than or equal to preset times, the three-level network is caused to ask function according between preset time Whether every repeating initiation network request, and the parameter value for adjusting back every time, it is the predetermined threshold value to judge it.
8. picture configuration device according to claim 6, it is characterised in that the 3rd calling module includes:
Ciphering unit, for generating splicing character string according to user profile, and using predetermined encryption algorithm to the splicing character string It is encrypted to obtain encrypted characters string;
Concatenation unit, for the encrypted characters string to be spliced to the URL of basic network to obtain network URL;
Creating unit, for choosing network request type and creating the second network request tool-class according to the network request type;
Network request unit, for obtaining the singleton in the second network request tool-class, passes through the singleton and the net Network URL initiates network request, and judges whether the network request succeeds according to the parameter value of readjustment.
9. a kind of electric terminal, it is characterised in that the electric terminal includes memory, processor and the claims 6-8 Any one of picture configuration device, the picture configuration device be installed on the memory and including it is one or more by The software function module of the computing device.
10. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the computer program The step in the picture collocation method any one of the claims 1-5 is realized upon execution.
CN201710536090.XA 2017-07-04 2017-07-04 Picture configuration method and device and electronic terminal Active CN107301053B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710536090.XA CN107301053B (en) 2017-07-04 2017-07-04 Picture configuration method and device and electronic terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710536090.XA CN107301053B (en) 2017-07-04 2017-07-04 Picture configuration method and device and electronic terminal

Publications (2)

Publication Number Publication Date
CN107301053A true CN107301053A (en) 2017-10-27
CN107301053B CN107301053B (en) 2020-12-15

Family

ID=60135576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710536090.XA Active CN107301053B (en) 2017-07-04 2017-07-04 Picture configuration method and device and electronic terminal

Country Status (1)

Country Link
CN (1) CN107301053B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109302467A (en) * 2018-09-19 2019-02-01 武汉斗鱼网络科技有限公司 Message distributing method, device, terminal and storage medium
CN110278271A (en) * 2019-06-24 2019-09-24 厦门美图之家科技有限公司 Network request control method, device and terminal device
CN110691108A (en) * 2018-07-04 2020-01-14 武汉斗鱼网络科技有限公司 Picture downloading and saving method and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1841369A (en) * 2005-03-29 2006-10-04 腾讯科技(深圳)有限公司 Configuration method for webpage display
US20130219261A1 (en) * 2012-02-17 2013-08-22 Ricoh Company, Ltd. Apparatus, information processing system, and information processing method
CN103309695A (en) * 2012-03-15 2013-09-18 腾讯科技(深圳)有限公司 Icon loading method and terminal
CN103617165A (en) * 2013-10-22 2014-03-05 小米科技有限责任公司 Picture loading method, device and terminal
US20140215499A1 (en) * 2013-01-31 2014-07-31 Kyocera Document Solutions Inc. Image Forming Apparatus and Method that Realize Function by Installed Application
CN105183346A (en) * 2015-08-27 2015-12-23 努比亚技术有限公司 Image display apparatus and method
CN106598679A (en) * 2016-12-21 2017-04-26 北京奇虎科技有限公司 Method and device for loading picture resources

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1841369A (en) * 2005-03-29 2006-10-04 腾讯科技(深圳)有限公司 Configuration method for webpage display
US20130219261A1 (en) * 2012-02-17 2013-08-22 Ricoh Company, Ltd. Apparatus, information processing system, and information processing method
CN103309695A (en) * 2012-03-15 2013-09-18 腾讯科技(深圳)有限公司 Icon loading method and terminal
US20140215499A1 (en) * 2013-01-31 2014-07-31 Kyocera Document Solutions Inc. Image Forming Apparatus and Method that Realize Function by Installed Application
CN103617165A (en) * 2013-10-22 2014-03-05 小米科技有限责任公司 Picture loading method, device and terminal
CN105183346A (en) * 2015-08-27 2015-12-23 努比亚技术有限公司 Image display apparatus and method
CN106598679A (en) * 2016-12-21 2017-04-26 北京奇虎科技有限公司 Method and device for loading picture resources

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110691108A (en) * 2018-07-04 2020-01-14 武汉斗鱼网络科技有限公司 Picture downloading and saving method and electronic equipment
CN110691108B (en) * 2018-07-04 2022-09-09 武汉斗鱼网络科技有限公司 Picture downloading and saving method and electronic equipment
CN109302467A (en) * 2018-09-19 2019-02-01 武汉斗鱼网络科技有限公司 Message distributing method, device, terminal and storage medium
CN110278271A (en) * 2019-06-24 2019-09-24 厦门美图之家科技有限公司 Network request control method, device and terminal device

Also Published As

Publication number Publication date
CN107301053B (en) 2020-12-15

Similar Documents

Publication Publication Date Title
US10924917B2 (en) Profile download method and system, and related device
CN103841134B (en) Based on API transmission, the method for receive information, apparatus and system
CN109150904A (en) Interface service call method and terminal device
CN107301053A (en) Picture collocation method, device and electric terminal
CN107015801A (en) A kind of web page display method and application terminal
CN113517985B (en) File data processing method and device, electronic equipment and computer readable medium
CN103873491A (en) VPN safe browser system and setting method
CN104954894A (en) Video traffic guiding method and device as well as electronic equipment
CN102594859B (en) A kind of rendering method of business datum, terminal, server and system
CN113595927A (en) Method and device for processing mirror flow in bypass mode
CN112165727A (en) Parallel network distribution system and method and mobile terminal
CN104767827A (en) Application starting method and device
CN104426960A (en) Paid application trying method and device thereof
CN104243568A (en) Data traffic sharing method and device
CN106302590A (en) Cloud platform
CN112015383A (en) Login method and device
CN111314355B (en) Authentication method, device, equipment and medium of VPN (virtual private network) server
CN102938782A (en) Message processing method, device and system
CN108370500B (en) Optimized settings for wireless devices
CN102932968B (en) The method of data card and data card networking
CN104202432A (en) Remote web management system and method
CN117149248A (en) Micro front end construction method, device, equipment and storage medium
US7164685B2 (en) Cookies or liberty enabler for processing all connections between user/agent and origin server in a wireless network for enabling cookies or liberty support services for users/agents
CN106856535A (en) A kind of notification message processing method and device
CN108681448A (en) Network request method, storage medium, electronic equipment and the system of IOS systems

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