[go: up one dir, main page]

CN109377385B - Front-end value taking method, front-end value taking device, computer readable storage medium and terminal - Google Patents

Front-end value taking method, front-end value taking device, computer readable storage medium and terminal Download PDF

Info

Publication number
CN109377385B
CN109377385B CN201811020701.6A CN201811020701A CN109377385B CN 109377385 B CN109377385 B CN 109377385B CN 201811020701 A CN201811020701 A CN 201811020701A CN 109377385 B CN109377385 B CN 109377385B
Authority
CN
China
Prior art keywords
hierarchy
source data
name
target
operation instruction
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.)
Active
Application number
CN201811020701.6A
Other languages
Chinese (zh)
Other versions
CN109377385A (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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201811020701.6A priority Critical patent/CN109377385B/en
Publication of CN109377385A publication Critical patent/CN109377385A/en
Application granted granted Critical
Publication of CN109377385B publication Critical patent/CN109377385B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/08Insurance

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of data processing, in particular to a front-end value taking method, a front-end value taking device, a computer readable storage medium and a terminal, wherein the method comprises the following steps: responding to an operation instruction of the front end, and requesting data required by the front end corresponding to the operation instruction from a server background; receiving source data returned by a server background, wherein the source data comprises a plurality of hierarchy names and corresponding hierarchy values; determining a target level name of data required by the front end according to the operation instruction, searching the target level name from the source data by using recursive processing, and acquiring a level value corresponding to the target level name from the source data; and applying the hierarchy value corresponding to the target hierarchy name to the operation of the front end. The invention can efficiently take values from the source data with multiple levels by utilizing the hardware configuration of the front end, thereby acquiring the data required by the front end and releasing the pressure of the server background.

Description

Front-end value taking method, front-end value taking device, computer readable storage medium and terminal
Technical Field
The present invention relates to the field of data processing, and in particular, to a front end value method, a front end value device, a computer readable storage medium, and a terminal.
Background
With the continuous development of internet technology and intelligent terminal hardware, the work that intelligent terminal hardware equipment can accomplish is continuously increased, the complexity is also continuously increased, in some use scenarios, the appointed data in a large amount of data need to be obtained, for example, the value of the data with multiple layers is obtained, the current value method is mostly carried out by a server background, the value of the data with multiple layers is obtained through logic coincidence operation, the code repeatability is higher, if a certain layer does not exist in the middle of the execution, the code can be directly reported wrong, the code can not be continuously executed downwards, meanwhile, the data needed by different front ends are needed to be adapted by the server background, a large amount of redundancy of the code is caused, the load of the server background is overlarge, the server background is required to have higher hardware configuration, meanwhile, the hardware configuration of the increasingly powerful intelligent terminal can not be utilized, and the waste of terminal resources is caused.
Disclosure of Invention
In order to solve the above technical problems, especially the problem that the prior art cannot efficiently take the value of the data with multiple levels, the following technical scheme is specifically proposed:
In a first aspect, the present invention provides a front-end value-taking method, including:
responding to an operation instruction of the front end, and requesting data required by the front end corresponding to the operation instruction from a server background;
receiving source data returned by a server background, wherein the source data comprises a plurality of hierarchy names and corresponding hierarchy values;
determining a target level name of data required by the front end according to the operation instruction, searching the target level name from the source data by using recursive processing, and acquiring a level value corresponding to the target level name from the source data;
And applying the hierarchy value corresponding to the target hierarchy name to the operation of the front end.
Further, after said searching for said target hierarchical name from said source data using recursive processing, further comprising:
if the target level name is not found in the source data, feeding back a preset reminding parameter to the front end, so that the front end receives the reminding parameter and then outputs corresponding reminding information.
Further, after the target level name is not found in the source data and the preset reminding parameter is fed back to the front end, the method further includes:
And after the current end receives the reminding parameter, sending error reporting information to the server background so that the server background processes the data required by the front end and feeds the processed data back to the front end.
Further, after the current end receives the reminding parameter, sending error reporting information to the server background, so that the server background processes the data required by the front end and feeds back the processed data to the front end, and the method comprises the following steps:
After the current side receives the reminding parameter, sending error reporting information carrying an operation instruction and a target level name to a server background; the server background searches whether the target level name is contained in the source data; if the target level name is not found, feeding back a default level value of the operation instruction to the front end; if the target hierarchy name is found, acquiring a hierarchy value corresponding to the target hierarchy name, and feeding back the hierarchy value of the target hierarchy name to the front end.
Optionally, the source data includes an array, an object, or a combination of an array and an object; the determining the target level name corresponding to the data required by the front end according to the operation instruction comprises the following steps:
If the source data comprises an array, determining an array index of data required by the front end according to the operation instruction, and determining a target level name according to the array index.
Further, after the step of applying the level value corresponding to the target level name to the front end, the method includes:
and judging whether the front end is abnormal, and if so, sending error reporting information of abnormal data application to a server background. .
In a second aspect, the present invention provides a front-end valuation apparatus, comprising:
and a response module: the method is used for responding to the operation instruction of the front end and requesting the data required by the front end corresponding to the operation instruction from the server background;
and a receiving module: the method comprises the steps of receiving source data returned by a server background, wherein the source data comprises a plurality of hierarchy names and corresponding hierarchy values;
And a value taking module: the method comprises the steps of determining a target hierarchy name of data required by a front end according to an operation instruction, searching the target hierarchy name from source data by using recursive processing, and obtaining a hierarchy value corresponding to the target hierarchy name from the source data;
And an application module: and the hierarchy value corresponding to the target hierarchy name is applied to the operation of the front end.
Further, the value module further includes execution of:
if the target level name is not found in the source data, feeding back a preset reminding parameter to the front end, so that the front end receives the reminding parameter and then outputs corresponding reminding information.
In a third aspect, the present invention also provides a computer readable storage medium, where a computer program is stored, the program implementing the front end value method described above when executed by a processor.
In a fourth aspect, the present invention also provides a terminal comprising one or more processors, a memory, one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the front-end valuation method described above.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a method for taking value of source data with complex hierarchy at front end, which comprises the steps of responding to an operation instruction of the front end to request the source data from a server background, then receiving the source data which is returned from the server background and contains a plurality of hierarchy names and corresponding hierarchy values, determining a target hierarchy name corresponding to the data required by the front end according to the operation instruction through code logic which is defined at the front end and is obtained from the source data, obtaining the hierarchy values corresponding to the target hierarchy names in the source data through recursion processing, enabling the server background not to adapt to the formats of the source data required by different front ends, enabling the server background to select the hierarchy values corresponding to the required target hierarchy names by the front end after returning basic source data to the front end, enabling the server background not to carry out excessive adaptation work on the data required by the front end, simplifying logic of the data required by the server background, enabling the server background to be easy to develop and maintain, and releasing the pressure of the server background.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow chart of a front end valuation method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another embodiment of the front-end valuation method of the present invention;
FIG. 3 is a schematic diagram of a front-end pointing device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an embodiment of the terminal of the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, but do not preclude the presence or addition of one or more other features, integers, steps, operations.
It will be understood by those skilled in the art that all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs unless defined otherwise. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
It will be appreciated by those skilled in the art that references to "application," "application program," "computer program," and similar concepts herein are intended to refer to computer software, organically constructed from a series of computer instructions and related data resources, suitable for electronic execution, as the same concepts are known to those skilled in the art. Unless specifically specified, such naming is not limited by the type, level of programming language, nor by the operating system or platform on which it operates. Of course, such concepts are not limited by any form of terminal.
The embodiment of the invention provides a front-end value-taking method, as shown in fig. 1, which comprises the following steps:
s10: and responding to the operation instruction of the front end, and requesting the data required by the front end corresponding to the operation instruction from the server background.
In this embodiment, the front end may be an application front end or an HTML web page front end, where the front end cooperates with the server background to display or apply data fed back by the server background at the front end, and this embodiment preferably uses the front end of the application as an example to illustrate that, after the front end performs a specific operation, a corresponding operation instruction is triggered, and then data required by the front end corresponding to the operation instruction is requested to the server background, where the operation instruction includes an update operation instruction, a display operation instruction, a query operation instruction, and the like, for example, in a security manager application, when a user enters a detail page of a certain insurance product, the detail information of the insurance product needs to be displayed at the front end for the user to browse, and at this time, the application responds to the query operation instruction of the front end, and requests the server background for the data required by the front end, that is, the detail data of the insurance product.
S20: and receiving source data returned by the server background, wherein the source data comprises a plurality of hierarchy names and corresponding hierarchy values.
In this embodiment, in order to reduce the computing pressure of the server background and reduce the logic complexity of the server background, the server background directly returns unified source data corresponding to a front-end specific function module to the front-end without simplifying the source data requested by the front-end under a non-specified condition, where the source data returned by the server background includes a plurality of data levels, each data level has a corresponding level name, and each data level has a corresponding level value, for example, one source data (object) is x= { a: { b: [ { c:1}, { d:2} } }, each data level includes a, b, c, d data levels, a, b, c, d also includes a level name of each data level, and all data levels possibly used by the front-end include four levels included in the source data. For example, the front end is a display page of the insurance product, the display page includes multiple insurance products such as S1, S2, S3, etc., the server background places the data required by each insurance product in different levels in the same source data, and when the data of which insurance product is required, the data required by the insurance product is obtained from the received source data, and a specific process is described below.
S30: and determining a target hierarchy name of data required by the front end according to the operation instruction, searching the target hierarchy name from the source data by using recursive processing, and acquiring a hierarchy value corresponding to the target hierarchy name from the source data.
After the front end receives source data returned by the server background, determining a target level name of the required data according to the operation instruction, namely determining a level name corresponding to the required data in the source data, for example, the operation instruction of the front end is to inquire and display detailed information of an insurance product S1, and the target level name corresponding to the data required by the operation instruction is a; the front-end operation instruction is to inquire and display detailed information of the insurance product S2, and the target level name corresponding to the data required by the operation instruction is b; then, the front end obtains the level value corresponding to the target level name from the source data by using recursive processing according to the target level name, for example, the received source data (object) is x= { a: { b: [ { c:1}, { d:2} }, the front end determines the target level name d of the required data according to the operation instruction, that is, the front end only needs to obtain the level value of the data level name d, at this time, recursive processing is used, after the source data x and the target level name d are determined, a level value corresponding to the level name d is searched for example safeProp (x, 'a', 'b',0,'d') in a circulation function according to the level names, and the circulation function performs recursive processing until the last incoming level name is circulated to the target level name, at this time, the level value corresponding to the level name is found in the source data, and then the level value can be obtained.
S40: and applying the hierarchy value corresponding to the target hierarchy name to the operation of the front end.
After the level value corresponding to the target level name is obtained from the source data, the level value of the target level name is applied to the operation of the front end, for example, the level value of the target level name a corresponding to the data required by the insurance product S1 is obtained from the source data, then the level value of the target level name is applied to the front end, and the detailed information of the insurance product S1 is displayed on the front end.
The front-end value-taking method of the embodiment is developed based on JavaScript language, and is implemented at the front end of a computer program, when a user performs a certain operation at the front end and needs to acquire new data and update a front-end page, the front-end requests source data from a server background and then processes the source data at the front end, the front end utilizes JavaScript to define logic for acquiring a required level value, and excessive adaptation work is not required at the server background for the data required by the front end, so that the logic for returning the data required by the front end at the server background is simplified, the server background is easy to develop and maintain, and the pressure of the server background is released.
The embodiment provides a method for taking a value of source data with a complex hierarchy at a front end, which comprises the steps of responding to an operation instruction of the front end to request the source data from a server background, then receiving the source data which is returned from the server background and contains a plurality of hierarchy names and corresponding hierarchy values, determining a target hierarchy name corresponding to data required by the front end according to the operation instruction through code logic which is defined at the front end and is used for acquiring the hierarchy values corresponding to the target hierarchy names in the source data, and then acquiring the hierarchy values corresponding to the target hierarchy names in the source data through recursion processing.
An embodiment of the present invention, as shown in fig. 2, further includes, after the searching the target hierarchy name from the source data using a recursive process:
s31: if the target level name is not found in the source data, feeding back a preset reminding parameter to the front end, so that the front end receives the reminding parameter and then outputs corresponding reminding information.
In this embodiment, because the computer program inevitably generates an error, the program cannot normally complete the specified operation, and in consideration of this situation, when the target level name required by the front end cannot be found in the source data, the front end is fed back with a preset reminding parameter, for example, the front end is fed back with a preset reminding parameter undefined, and after the front end receives the reminding parameter undefined, the front end triggers the subsequent reminding logic and outputs corresponding reminding information, for example, after triggering the reminding logic, outputs the reminding information "please refresh once again", and reminds the user to refresh the page again to acquire the source data again. Further, in this embodiment, different reminding parameters are fed back to the front end according to different error types, and then different reminding information is displayed at the front end according to the different reminding parameters. In this embodiment, under the condition that the source data hierarchy is relatively complex, even if a certain hierarchy in the middle does not exist or the name of the incoming target hierarchy is wrong, the program code will not report errors, but a preset reminding parameter is returned to the front end according to the situation, and the front end receives the reminding parameter to solve the problem of error reporting.
In one embodiment of the present invention, after the target level name is not found in the source data, feeding back a preset reminding parameter to the front end, the method further includes:
And after the current end receives the reminding parameter, sending error reporting information to the server background so that the server background processes the data required by the front end and feeds the processed data back to the front end.
In this embodiment, after the front end receives the preset reminding parameter, the front end knows that the operation of this time is wrong, at this time, the error information is reported to the server background, after the server background receives the error information, the data required by the front end is processed in the server background, the source data with a complex level is not returned to the front end, but is directly fed back to the data required by the front end, and the front end can be directly applied to the operation of the front end when receiving the processed data fed back by the server background, so that the front end does not need to perform the level value processing according to the target level name, and the problem that the front end cannot always acquire the required level value and poor experience is brought to a user is avoided.
In one embodiment of the present invention, after the current end receives the alert parameter, the current end sends error reporting information to the server background, so that the server background processes the data required by the front end and feeds back the processed data to the front end, and the method includes:
After the current side receives the reminding parameter, sending error reporting information carrying an operation instruction and a target level name to a server background; the server background searches whether the target level name is contained in the source data; if the target level name is not found, feeding back a default level value of the operation instruction to the front end; if the target hierarchy name is found, acquiring a hierarchy value corresponding to the target hierarchy name, and feeding back the hierarchy value of the target hierarchy name to the front end.
In this embodiment, after a current terminal receives a preset reminding parameter, the current terminal sends error reporting information carrying an operation instruction of a current sending error and a target level name to a server background, after the server background receives the error reporting information, the server background can directly search whether the current terminal includes the target level name and a corresponding level value from the source data, if the current terminal cannot find the target level name, the default level value of the operation instruction is fed back to a front end, but not the information of the level value which cannot be found by feedback, if the current terminal cannot find the target level name, the level value corresponding to the target level name is obtained, and then the level value is fed back to the front end.
Further, the server background can adjust a rule for generating source data according to the error reporting information, so that the front end can determine a target hierarchy name and a corresponding hierarchy value according to the operation instruction.
In one embodiment of the present invention, the source data includes an array, an object, or a combination of an array and an object; the determining the target level name corresponding to the data required by the front end according to the operation instruction comprises the following steps:
If the source data comprises an array, determining an array index of data required by the front end according to the operation instruction, and determining a target level name according to the array index.
In this embodiment, the data set may be represented by an array, or may be represented by an object, for example, the source data may be represented by an array a= [1,2,3,4] or represented by an object a= {0:1,1:2,2:3,3:4}, the source data may better represent the order of the data set by using the array representation, and the object representation is a set of unordered data.
An embodiment of the present invention further includes, after the operation of applying the hierarchy value corresponding to the target hierarchy name to a front end, the steps of:
And judging whether the front end is abnormal, and if so, sending error reporting information of abnormal data application to a server background.
After the front end obtains the required data, i.e. after the operation of applying the level value corresponding to the target level name to the front end, the front end may still not use the level value, for example, the level value is already in error configuration in the server background, after the level value is transmitted to the front end, the front end uses the level value in error configuration, and still cannot normally complete the operation of the front end, at this time, whether the front end transmits an exception is judged, if yes, data application exception reporting information is transmitted to the server background, unlike the data application exception reporting information which cannot be found, the reporting information in this embodiment is the data application exception reporting information, and the cause of coarse data exception can be found from the source through the reporting information, so that the front end can work more stably.
In another embodiment, as shown in fig. 3, the present invention provides a front-end valuation apparatus, including:
response module 10: the method is used for responding to the operation instruction of the front end and requesting the data required by the front end corresponding to the operation instruction from the server background;
the receiving module 20: the method comprises the steps of receiving source data returned by a server background, wherein the source data comprises a plurality of hierarchy names and corresponding hierarchy values;
A value module 30: the method comprises the steps of determining a target hierarchy name of data required by a front end according to an operation instruction, searching the target hierarchy name from source data by using recursive processing, and obtaining a hierarchy value corresponding to the target hierarchy name from the source data;
Application module 40: and the hierarchy value corresponding to the target hierarchy name is applied to the operation of the front end.
In one embodiment of the present invention, the value module 30 further includes executing:
if the target level name is not found in the source data, feeding back a preset reminding parameter to the front end, so that the front end receives the reminding parameter and then outputs corresponding reminding information.
In one embodiment of the present invention, after the target level name is not found in the source data, feeding back a preset reminding parameter to the front end, the method further includes:
And after the current end receives the reminding parameter, sending error reporting information to the server background so that the server background processes the data required by the front end and feeds the processed data back to the front end.
In one embodiment of the present invention, after the current end receives the alert parameter, the current end sends error reporting information to the server background, so that the server background processes the data required by the front end and feeds back the processed data to the front end, and the method includes:
After the current side receives the reminding parameter, sending error reporting information carrying an operation instruction and a target level name to a server background; the server background searches whether the target level name is contained in the source data; if the target level name is not found, feeding back a default level value of the operation instruction to the front end; if the target hierarchy name is found, acquiring a hierarchy value corresponding to the target hierarchy name, and feeding back the hierarchy value of the target hierarchy name to the front end.
In one embodiment of the present invention, the source data includes an array, an object, or a combination of an array and an object; the value-taking module 30 executes a target level name corresponding to the data required by the front end according to the operation instruction, including:
If the source data comprises an array, determining an array index of data required by the front end according to the operation instruction, and determining a target level name according to the array index.
In another embodiment, the present invention provides a computer readable storage medium, where a computer program is stored, where the program is executed by a processor to implement the front-end value method described in the foregoing embodiment. The computer readable storage medium includes, but is not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks, ROMs (Read-Only memories), RAMs (Random AcceSS Memory, random access memories), EPROMs (EraSable Programmable Read-Only memories), EEPROMs (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only memories), flash memories, magnetic cards, or optical cards. That is, a storage device includes any medium that stores or transmits information in a form readable by a device (e.g., computer, cell phone), and may be read-only memory, magnetic or optical disk, etc.
The computer readable storage medium provided by the embodiment of the invention can realize that the data required by the front end corresponding to the operation instruction is requested to the server background in response to the operation instruction of the front end; receiving source data returned by a server background, wherein the source data comprises a plurality of hierarchy names and corresponding hierarchy values; determining a target level name of data required by the front end according to the operation instruction, searching the target level name from the source data by using recursive processing, and acquiring a level value corresponding to the target level name from the source data; and applying the hierarchy value corresponding to the target hierarchy name to the operation of the front end. The method comprises the steps of providing a method for taking a value of source data with a complex hierarchy at a front end, requesting the source data from a server background by responding to an operation instruction of the front end, then receiving the source data which is returned by the server background and contains a plurality of hierarchy names and corresponding hierarchy values, determining a target hierarchy name corresponding to data required by the front end according to the operation instruction through code logic which is defined at the front end and is used for acquiring the hierarchy values corresponding to the target hierarchy names in the source data, and then acquiring the hierarchy values corresponding to the target hierarchy names in the source data through recursion processing.
The embodiment of the front end value method can be implemented by the computer readable storage medium provided by the embodiment of the present invention, and specific function implementation is described in the method embodiment and is not repeated herein.
In addition, in another embodiment, the present invention further provides a terminal, as shown in fig. 4, where the terminal includes a processor 403, a memory 405, an input unit 407, and a display unit 409. Those skilled in the art will appreciate that the structural elements shown in fig. 4 do not constitute a limitation on all terminals and may include more or fewer components than shown, or may combine certain components. The memory 405 may be used to store a computer program 401 and various functional modules, and the processor 403 runs the computer program 401 stored in the memory 405, thereby executing various functional applications of the device and data processing. The memory 405 may be or include both internal memory and external memory. The internal memory may include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), flash memory, or random access memory. The external memory may include a hard disk, floppy disk, ZIP disk, U-disk, tape, etc. The disclosed memory includes, but is not limited to, these types of memory. The memory 405 disclosed herein is by way of example only and not by way of limitation.
The input unit 407 is configured to receive input of a signal and receive input of a user, and the input unit 407 may include a touch panel and other input devices, where the touch panel may collect touch operations (such as operations of a user using any suitable object or accessory such as a finger, a stylus, etc. on or near the touch panel) thereon or nearby by the user, and drive the corresponding connection device according to a preset program; other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., play control keys, switch keys, etc.), a trackball, mouse, joystick, etc. The display unit 409 may be used to display information input by a user or information provided to the user as well as various menus of the computer device. The display unit 409 may take the form of a liquid crystal display, an organic light emitting diode, or the like. The processor 403 is a control center of the computer device, connects various parts of the entire computer using various interfaces and lines, performs various functions and processes data by running or executing software programs and/or modules stored in the memory 403, and invoking data stored in the memory.
In one embodiment, the terminal comprises one or more processors 403, and one or more memories 405, one or more computer programs 401, wherein the one or more computer programs 401 are stored in the memories 405 and configured to be executed by the one or more processors 403, the one or more computer programs 401 being configured to perform the front-end valuation method described in the above embodiments. The one or more processors 403 shown in fig. 4 are capable of executing and implementing the functions of the response module 10, the receiving module 20, the value module 30, and the application module 40 shown in fig. 3.
The terminal provided by the embodiment of the invention can respond to the operation instruction of the front end and request the data required by the front end corresponding to the operation instruction to the server background; receiving source data returned by a server background, wherein the source data comprises a plurality of hierarchy names and corresponding hierarchy values; determining a target level name of data required by the front end according to the operation instruction, searching the target level name from the source data by using recursive processing, and acquiring a level value corresponding to the target level name from the source data; and applying the hierarchy value corresponding to the target hierarchy name to the operation of the front end. The method comprises the steps of providing a method for taking a value of source data with a complex hierarchy at a front end, requesting the source data from a server background by responding to an operation instruction of the front end, then receiving the source data which is returned by the server background and contains a plurality of hierarchy names and corresponding hierarchy values, determining a target hierarchy name corresponding to data required by the front end according to the operation instruction through code logic which is defined at the front end and is used for acquiring the hierarchy values corresponding to the target hierarchy names in the source data, and then acquiring the hierarchy values corresponding to the target hierarchy names in the source data through recursion processing.
The terminal provided by the embodiment of the present invention can implement the embodiment of the front end value method provided above, and specific function implementation is referred to the description in the method embodiment, and will not be repeated here.
The foregoing is only a partial embodiment of the present invention, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (5)

1. A front-end valuation method, comprising:
responding to an operation instruction of the front end, and requesting data required by the front end corresponding to the operation instruction from a server background;
Receiving source data returned by a server background, wherein the source data comprises a plurality of hierarchy names and corresponding hierarchy values; the source data includes an array, an object, or a combination of an array and an object;
if the source data comprises an array, determining an array index of data required by the front end according to the operation instruction, determining a target level name according to the array index, searching the target level name from the source data by using recursive processing, and acquiring a level value corresponding to the target level name from the source data;
if the target level name cannot be found in the source data, feeding back a preset reminding parameter to the front end, so that the front end receives the reminding parameter and then outputs corresponding reminding information;
After the current side receives the reminding parameter, sending error reporting information carrying an operation instruction and a target level name to a server background; the server background searches whether the target level name is contained in the source data; if the target level name is not found, feeding back a default level value of the operation instruction to the front end; if the target hierarchy name is found, acquiring a hierarchy value corresponding to the target hierarchy name, and feeding back the hierarchy value of the target hierarchy name to the front end;
And applying the hierarchy value corresponding to the target hierarchy name to the operation of the front end.
2. The method according to claim 1, comprising, after said applying the hierarchy value corresponding to the target hierarchy name to the operation of the front end:
And judging whether the front end is abnormal, and if so, sending error reporting information of abnormal data application to a server background.
3. A front-end valuation apparatus, comprising:
and a response module: the method is used for responding to the operation instruction of the front end and requesting the data required by the front end corresponding to the operation instruction from the server background;
And a receiving module: the method comprises the steps of receiving source data returned by a server background, wherein the source data comprises a plurality of hierarchy names and corresponding hierarchy values; the source data includes an array, an object, or a combination of an array and an object;
And a value taking module: if the source data comprises an array, determining an array index of data required by the front end according to the operation instruction, determining a target level name according to the array index, searching the target level name from the source data by using recursive processing, and acquiring a level value corresponding to the target level name from the source data;
the value taking module is used for: if the source data cannot find the target level name, feeding back a preset reminding parameter to the front end, so that the front end can output corresponding reminding information after receiving the reminding parameter;
The value taking module is used for: the method is also used for sending error reporting information carrying an operation instruction and a target level name to a server background after the current terminal receives the reminding parameter; the server background searches whether the target level name is contained in the source data; if the target level name is not found, feeding back a default level value of the operation instruction to the front end; if the target hierarchy name is found, acquiring a hierarchy value corresponding to the target hierarchy name, and feeding back the hierarchy value of the target hierarchy name to the front end;
And an application module: and the hierarchy value corresponding to the target hierarchy name is applied to the operation of the front end.
4. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the front-end valuation method of any of claims 1 to 2.
5. A terminal, comprising:
One or more processors;
a memory;
One or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more computer programs configured to perform the front-end valuation method of any of claims 1-2.
CN201811020701.6A 2018-09-03 2018-09-03 Front-end value taking method, front-end value taking device, computer readable storage medium and terminal Active CN109377385B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811020701.6A CN109377385B (en) 2018-09-03 2018-09-03 Front-end value taking method, front-end value taking device, computer readable storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811020701.6A CN109377385B (en) 2018-09-03 2018-09-03 Front-end value taking method, front-end value taking device, computer readable storage medium and terminal

Publications (2)

Publication Number Publication Date
CN109377385A CN109377385A (en) 2019-02-22
CN109377385B true CN109377385B (en) 2024-09-13

Family

ID=65404990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811020701.6A Active CN109377385B (en) 2018-09-03 2018-09-03 Front-end value taking method, front-end value taking device, computer readable storage medium and terminal

Country Status (1)

Country Link
CN (1) CN109377385B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143383B (en) * 2019-12-20 2023-07-14 五八有限公司 Data updating method and device, electronic equipment and storage medium
CN111367225A (en) * 2020-04-02 2020-07-03 南京捷希科技有限公司 Control device, system and method based on microprocessor

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603684A (en) * 2016-12-22 2017-04-26 北京微影时代科技有限公司 Information display method and device, and user terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7349893B2 (en) * 2004-04-29 2008-03-25 Microsoft Corporation Hierarchical user interface query automation

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603684A (en) * 2016-12-22 2017-04-26 北京微影时代科技有限公司 Information display method and device, and user terminal

Also Published As

Publication number Publication date
CN109377385A (en) 2019-02-22

Similar Documents

Publication Publication Date Title
CN109614347B (en) Processing method and device for multi-level cache data, storage medium and server
CN101529865B (en) Method for recommending short-cuts in order to ease and fasten navigating within navigation topology
US20200387804A1 (en) Constructing and utilizing a knowledge graph for information technology infrastructure
US20210374415A1 (en) Method and apparatus for identifying video
US9119056B2 (en) Context-driven application information access and knowledge sharing
US9245030B2 (en) Analytics based on pipes programming model
US11537683B2 (en) Configuration of content site user interaction monitoring in data networks
US20240345836A1 (en) Dynamic review of software updates after pull requests
US12332931B2 (en) Priming generative AI model leveraging directed acyclic graph-driven notebook environment
CN109377385B (en) Front-end value taking method, front-end value taking device, computer readable storage medium and terminal
CN112214697B (en) Webpage processing method, webpage processing device, computer equipment and storage medium
US12001458B2 (en) Multi-cloud object store access
CN117955969A (en) File uploading method and device, electronic equipment and storage medium
CN113157722B (en) Data processing method, device, server, system and storage medium
CN115357325A (en) Data display method, device, equipment and medium based on vue framework
CN109726009B (en) Big data computing method, device, equipment and computer readable storage medium
CN114968505A (en) Task processing system, method, apparatus, device, storage medium and program product
US20240176871A1 (en) Systems and methods for software execution environment management
CN118819951B (en) A government service data backup method and related device based on cloud service
US20190243515A1 (en) Invoke a Service in an Electronic Document Using a Trigger Entry
US20240354420A1 (en) Visualization of security vulnerabilities
US20090313628A1 (en) Dynamically batching remote object model commands
CN117372182B (en) Insurance management system based on rapid development persistent layer code auxiliary method
US11947931B2 (en) Generic factory class
US12235920B1 (en) Preventing double actions in a single-click environment

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