CN112256445A - Data processing method, device and equipment based on application program and storage medium - Google Patents

Data processing method, device and equipment based on application program and storage medium Download PDF

Info

Publication number
CN112256445A
CN112256445A CN202010720879.2A CN202010720879A CN112256445A CN 112256445 A CN112256445 A CN 112256445A CN 202010720879 A CN202010720879 A CN 202010720879A CN 112256445 A CN112256445 A CN 112256445A
Authority
CN
China
Prior art keywords
data
displayed
service
transmission object
attribute
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
CN202010720879.2A
Other languages
Chinese (zh)
Other versions
CN112256445B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010720879.2A priority Critical patent/CN112256445B/en
Publication of CN112256445A publication Critical patent/CN112256445A/en
Application granted granted Critical
Publication of CN112256445B publication Critical patent/CN112256445B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

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

Abstract

The embodiment of the invention provides a data processing method, a device, equipment and a storage medium based on an application program, wherein the method comprises the following steps: receiving back-end service data sent by a back-end application layer, wherein the back-end service data corresponds to a service request sent by a front-end application layer; determining a data processing strategy matched with the back-end service data, wherein the data processing strategy comprises attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion strategy for converting the back-end service data into the front-end data to be displayed; processing the back-end service data according to the data processing strategy to obtain front-end data to be displayed; and sending the data to be displayed at the front end to a front-end application layer so as to display the data to be displayed at the front end. Therefore, the data structure of the data to be displayed at the front end can be obtained, the problem of pollution caused by data transmission at the front end and the rear end can be avoided, and the difficulty in maintaining and upgrading the application program is effectively reduced.

Description

Data processing method, device and equipment based on application program and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data processing method, a data processing device, data processing equipment and a storage medium based on an application program.
Background
With the development of mobile internet and smart terminals, various application programs are widely developed and used. Applications are generally divided into a front-end application layer and a back-end application layer. The front-end application layer can provide different types of front-end display pages for users, and the back-end application layer provides at least one specific service.
When an application program is developed, in order to improve the convenience of programming for developers, a JavaScript scripting language is generally used for programming.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: since the JavaScript scripting language is a weak type language, after the application program runs on the line for a period of time, the data structure of the data in the application program cannot be conveniently obtained, and the data is transmitted from the front end to the back end, which causes great difficulty in subsequent maintenance and upgrading of the application program.
Disclosure of Invention
Embodiments of the present invention provide a data processing method, an apparatus, a device, and a storage medium based on an application program, so as to solve the technical problems that in the prior art, a data structure of data in the application program cannot be conveniently obtained, and pollution occurs when the data is transmitted from a front end to a back end, which makes subsequent maintenance and upgrade of the application program very difficult.
In a first aspect, an embodiment of the present invention provides an application-based data processing method, where the method is applied to a data processing layer, where the data processing layer is located between a front-end application layer and a back-end application layer, and the method includes:
receiving back-end service data sent by the back-end application layer, wherein the back-end service data corresponds to a service request sent by a front-end application layer; determining a data processing strategy matched with the back-end service data, wherein the data processing strategy comprises attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion strategy for converting the back-end service data into the front-end data to be displayed; processing the back-end service data according to the data processing strategy to obtain front-end data to be displayed; and sending the front-end data to be displayed to a front-end application layer so as to display the front-end data to be displayed.
Optionally, in the method described above, the data processing layer is installed in a node.js operating environment, and the data processing policy is expressed by a front-end data transmission object;
the determining the data processing policy matched with the backend service data includes:
determining a backend data transmission object matched with the backend service data; acquiring a front-end data transmission object having a mapping relation with the back-end data transmission object; and determining the front-end data transmission object with the mapping relation as a data processing strategy matched with the back-end service data.
In the embodiment of the invention, the data processing layer is carried in a node.js operating environment, the data processing layer can effectively isolate the front-end application layer from the rear-end application layer, the data processing strategy is expressed by adopting the front-end data transmission object, the front-end data transmission object matched with the rear-end service data is determined according to the constructed mapping relation between the rear-end data transmission object and the front-end data transmission object, the front-end application layer and the rear-end application layer can be completely decoupled, no mutual dependence exists, and the pollution problem caused by data transmission at the front end and the rear end is further avoided.
Optionally, the constructing a backend data transmission object corresponding to each service in the backend application layer according to the method described above includes:
determining a first attribute name and a first attribute type of back-end service data of each service in the back-end application layer; forming a first key-value pair by the first attribute name and the first attribute type; and constructing a corresponding back-end data transmission object according to the first key value pair corresponding to the back-end service data.
In this embodiment, when a backend data transmission object corresponding to each service in the backend application layer is constructed, the attribute information of the backend service data is stored by using the first key value, so that the data structure of the backend service data can be efficiently obtained when the application program is maintained and updated, and the difficulty in maintaining and updating the application program is further reduced.
Optionally, the constructing a front-end data transmission object corresponding to each service in the back-end application layer according to the method described above includes:
acquiring display information of front-end data to be displayed of each service in the back-end application layer; constructing second attribute information of front-end data to be displayed in the corresponding front-end data transmission object according to the display information;
acquiring first attribute information of back-end service data corresponding to front-end data to be displayed; and constructing a conversion strategy in the corresponding front-end data transmission object according to the first attribute information and the corresponding second attribute information.
In this embodiment, the second attribute information of the front-end data to be displayed in the corresponding front-end data transmission object is constructed according to the display information of the front-end data to be displayed of each service, and the display information can accurately express the display state of the front-end data to be displayed, so that the constructed second attribute information of the front-end data to be displayed is more accurate. And the conversion strategy can be accurately determined according to the first attribute information of the back-end service data and the second attribute information of the corresponding front-end data to be displayed.
Optionally, in the method, at least one of the back-end service data corresponding to each service and the corresponding front-end data to be displayed is provided;
the constructing of the mapping relationship between the back-end data transmission object and the front-end data transmission object corresponding to each service includes: for each service, acquiring a first key value pair corresponding to each back-end service data in a back-end data transmission object, and acquiring a second key value pair corresponding to each front-end to-be-displayed data in a corresponding front-end data transmission object; and constructing a mapping relation between the first key-value pair and the corresponding second key-value pair.
In the embodiment of the invention, when the mapping relation between the back-end data transmission object and the front-end data transmission object corresponding to each service is established, the mapping relation between the first key value pair corresponding to each back-end service data and the second key value pair corresponding to the front-end data to be displayed is established, so that the mapping relation between each data attribute information in the back-end data transmission object and the front-end data transmission object can be established more accurately, and the converted front-end data to be displayed is more accurate.
Optionally, as in the method described above, the sending the front-end data to be displayed to a front-end application layer includes:
and sending the data to be displayed at the front end to a functional logic layer so that the functional logic layer renders the data to be displayed at the front end and sends the data to the front end application layer.
According to the embodiment of the invention, the functional logic layer is constructed between the data processing layer and the front-end application layer, and after the data to be displayed at the front end is determined by the data processing layer, the data to be displayed at the front end is rendered through the functional logic layer, so that when the data to be displayed at the front end is displayed by the front-end application layer, the display requirement can be met better, and the experience of a user using an application program is improved.
In a second aspect, an embodiment of the present invention provides an application-based data processing apparatus, including: the apparatus is located at a data processing layer, the data processing layer being located between a front-end application layer and a back-end application layer, the apparatus comprising:
the data receiving module is used for receiving back-end service data sent by the back-end application layer, wherein the back-end service data corresponds to a service request sent by the front-end application layer; the processing strategy determining module is used for determining a data processing strategy matched with the back-end service data, wherein the data processing strategy comprises attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion strategy for converting the back-end service data into the front-end data to be displayed; the data processing module is used for processing the back-end service data according to the data processing strategy so as to obtain front-end data to be displayed; and the data sending module is used for sending the front-end data to be displayed to a front-end application layer so as to display the front-end data to be displayed.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to be capable of performing the method of any one of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, in which computer-executable instructions are stored, and when executed by a processor, the computer-executable instructions are used to implement the method according to any one of the first aspect.
According to the data processing method, the device, the equipment and the storage medium based on the application program, provided by the embodiment of the invention, the back-end service data sent by the back-end application layer is received, and the back-end service data corresponds to the service request sent by the front-end application layer; determining a data processing strategy matched with the back-end service data, wherein the data processing strategy comprises attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion strategy for converting the back-end service data into the front-end data to be displayed; processing the back-end service data according to the data processing strategy to obtain front-end data to be displayed; and sending the data to be displayed at the front end to a front-end application layer so as to display the data to be displayed at the front end. Because the attribute information of the pre-defined front-end data to be displayed comprises the attribute type of the front-end data to be displayed, the data structure of the front-end data to be displayed can be obtained, and after the data processing layer is established, the change of the back-end service data can unify the front-end data to be displayed in the process of converting the back-end service data into the front-end data to be displayed on the data processing layer, so that the problem of pollution caused by the transmission of the data at the front end and the back end can be avoided, and the difficulty of maintaining and upgrading the application program is effectively reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a diagram of a first system architecture in which a data processing method for an application program according to an embodiment of the present invention can be implemented;
FIG. 2 is a flowchart illustrating an application-based data processing method according to an embodiment of the present invention;
FIG. 3 is a diagram of a second system architecture for implementing a data processing method for an application according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for processing data based on an application according to another embodiment of the present invention;
fig. 5 is a schematic diagram of a dependency relationship in a front-end data transmission object in the data processing method based on the application program according to another embodiment of the present invention;
fig. 6 is a schematic diagram illustrating a relationship between backend service data, a front-end data transmission object and data to be displayed at the front end in the data processing method based on the application program according to another embodiment of the present invention;
FIG. 7 is a block diagram of an application-based data processing apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of an application-based data processing apparatus according to another embodiment of the present invention;
FIG. 9 is a first block diagram of an electronic device for implementing an application-based data method of an embodiment of the present invention;
FIG. 10 is a second block diagram of an electronic device for implementing an application-based data method of an embodiment of the present invention.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
For a clear understanding of the technical solutions of the present application, the prior art solutions can be first described in detail.
In the prior art, when an application program is developed, in order to improve the convenience of programming for developers, a JavaScript (JavaScript) script language is generally adopted for programming. Since the JavaScript scripting language is a weak type language, after the application program runs on the line for a period of time, the data structure of the data in the application program cannot be conveniently obtained, and the data is transmitted from the front end to the back end, which causes great difficulty in subsequent maintenance and upgrading of the application program.
The pollution problem occurring when data is transmitted from the front end to the back end means that if the back end service data in the back end service layer is modified, the front end application layer also needs to be modified synchronously. Namely, the whole application program is synchronously modified due to the change of the back-end service data every time, so that the whole application program is polluted by the back-end service data.
In order to solve the problem that the data structure of data in an application program cannot be conveniently obtained, the current solution is to use a strong type language TypeScript to replace a JavaScript language or use a structure for transmitting data at the front end and the rear end of a text remark. However, in the process of adopting the TypeScript language to replace the JavaScript language, the method is comprehensive code modification, the consumed labor cost is high, and the problem of untimely document updating exists in the structure of transmitting data by adopting the front end and the back end of the text remark. And the two methods cannot solve the pollution problem when data is transmitted from the front end to the back end.
Therefore, the inventor has found in research that, when the data structure of data in an application program cannot be conveniently obtained in the prior art and the data is transmitted between a front-end application layer and a back-end application layer, a data processing layer can be constructed between the front-end application layer and the back-end application layer, the data processing layer can include a data processing strategy, the data processing strategy is responsible for predefining attribute information of data to be displayed at the front end and a conversion strategy for converting back-end service data into the data to be displayed at the front end when the data is transmitted between the front-end application layer and the back-end application layer, after the data processing layer receives the back-end service data transmitted by the back-end application layer, the back-end service data can be processed according to the data processing strategy, converted into the attribute information required by the data to be displayed at the front end, and the converted data to be displayed at the front end is transmitted to the front-end application layer, so as to display the data to be displayed at the front end. Because the attribute information of the pre-defined front-end data to be displayed comprises the attribute type of the front-end data to be displayed, the data structure of the front-end data to be displayed can be obtained, and after the data processing layer is established, the change of the back-end service data can unify the front-end data to be displayed in the process of converting the back-end service data into the front-end data to be displayed on the data processing layer, so that the problem of pollution caused by the transmission of the data at the front end and the back end can be avoided, and the difficulty of maintaining and upgrading the application program is effectively reduced.
Therefore, the inventor proposes a technical scheme of the embodiment of the invention based on the above creative discovery. The system architecture of the data processing method based on the application program provided by the embodiment of the invention is introduced below. As shown in fig. 1, the system architecture corresponding to the application program includes a front-end application layer, a data processing layer and a back-end application layer. The front-end application layer can provide different types of front-end display pages for users, such as Web pages, H5 pages, APP pages, applet pages or other clients. The back-end application layer may provide different services to the user depending on the type of application. If the application is a shopping application, the services available at the back-end application layer may include: login services, product services, user services, order services and other services, etc. The data processing layer is positioned between the back-end application layer and the front-end application layer, and can be mounted in a node. In an optional application scenario, after a front-end application layer receives a service request triggered by a user, a data processing layer can perform validity check on the service request and send the service request to a back-end application layer, the back-end application layer obtains back-end service data of a corresponding interface according to the service request and sends the back-end service data to the data processing layer, a plurality of data processing strategies are stored in the data processing layer in advance, a data processing strategy matched with the back-end service data is determined, so that attribute information of front-end data to be displayed corresponding to the back-end service data is determined, wherein the attribute information comprises an attribute name and an attribute type, and the attribute type represents a data structure of the front-end data to be displayed. And the data processing strategy also comprises a conversion strategy for converting the back-end service data into the front-end data to be displayed, and when the back-end service is processed according to the data processing strategy, the back-end service data is converted into the front-end data to be displayed according to the conversion strategy, so that the attribute information of the front-end data to be displayed is the attribute information predefined in the data processing strategy. And sending the data to be displayed at the front end to a front end application layer so as to display the data to be displayed at the front end.
According to the embodiment of the invention, the predefined attribute information of the data to be displayed at the front end comprises the attribute type of the data to be displayed at the front end, so that the data structure of the data to be displayed at the front end can be obtained, and after the data processing layer is established, the change of the back-end service data can unify the data to be displayed at the front end in the process of converting the back-end service data into the data to be displayed at the front end by the data processing layer, so that the problem of pollution caused by the data transmitted from the front end to the back end can be avoided, and the difficulty of maintaining and upgrading the application program can be effectively reduced.
The terms referred to in the embodiments of the present invention are explained below:
js: js uses an event-driven, non-blocking I/O model based on the JavaScript running environment of Chrome V8 engine. Node is a development platform for operating JavaScript at a server, and the JavaScript becomes a scripting language which is flush with the languages of the server such as PHP, Python, Perl, Ruby and the like. The network application with high response speed and easy expansion can be conveniently established. Nodes use an event-driven, non-blocking I/O model to be lightweight and efficient, and are well suited to running data-intensive real-time applications on distributed devices.
Data transmission object: english is: data Transfer Object, abbreviation: DTO. The method is a software application system for transmitting data between design modes;
JSON: is a lightweight data exchange format that stores and represents data in a text format that is completely independent of the programming language. Which makes JSON an ideal data exchange language due to a compact and clear hierarchy. The network transmission method is easy to read and write by people, is easy to analyze and generate by machines, and effectively improves the network transmission efficiency.
The following describes the technical solution of the present invention and how to solve the above technical problems with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Example one
Fig. 2 is a schematic flowchart of a data processing method based on an application program according to an embodiment of the present invention, and as shown in fig. 2, an execution main body of the data processing method based on the application program according to the embodiment of the present invention is a data processing apparatus based on the application program, the data processing apparatus based on the application program may be located in a data processing layer, the application program may be loaded in an electronic device, and the electronic device may be a computer, a notebook computer, a smart phone, or other device having independent computing and processing capabilities, and then the data processing method based on the application program according to the embodiment of the present invention includes the following steps:
step 101, receiving backend service data sent by a backend application layer, where the backend service data corresponds to a service request sent by a front-end application layer.
In this embodiment, the front-end application layer displays a front-end presentation page for the user, where the type of the front-end presentation page is not limited. Such as may be a Web page, H5 page, APP page, portlet page, or other client, etc.
And displaying data of different services for the user in the front-end display page. The data it exposes is related to the type of application. If the application is a shopping application, the front-end display page may display shopping service data, order service data, user service data, and the like.
Specifically, after the user opens the application program, the front-end display page is displayed, and the user can trigger a certain service request in a manner of triggering a control in the front-end display page. Such as a request for an order query, a user login request, a merchandise search request, etc.
And then the data processing layer can check the legality of the service request after receiving the service request, and after the check is passed, the data processing layer sends the service request to the back-end application layer so that the back-end application layer analyzes the service request to obtain the identification information of the service request, and then obtains back-end service data from the corresponding service interface. The backend service data corresponds to the service request sent by the front-end application layer.
And the data processing layer receives the back-end service data sent by the back-end application layer. For example, if the service request triggered by the user is an order query request, the backend service data acquired by the backend application layer from the order service is order query result data, and the backend service data may include: order serial number, trade name, order creation time, payment amount, payment method and the like.
Step 102, determining a data processing strategy matched with the back-end service data, wherein the data processing strategy comprises attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion strategy for converting the back-end service data into the front-end data to be displayed.
Specifically, in this embodiment, a data processing policy corresponding to each service is stored in the data processing layer in advance, and the data processing policy corresponding to each service includes attribute information of front-end data to be displayed and a conversion policy for converting back-end service data into front-end data to be displayed.
The attribute information of the data to be displayed at the front end may include: attribute name and attribute type. Wherein the attribute type represents a type of the data structure. Such as character type, integer type, single precision type, double precision type, array type, method type, etc.
It can be understood that the number of the front-end data to be displayed corresponding to each service may be one or more, and if the number of the front-end data to be displayed is more than one, the attribute information of each front-end data to be displayed and each conversion policy for converting the back-end service data into the corresponding front-end data to be displayed are sequentially stored in the data processing policy. The attribute information of the data to be displayed at the front end can be stored in a key value pair mode, and keys in the key value pair store attribute names and values store attribute types.
In this embodiment, the storage manner of the data processing policy may be in a form of a data transfer object (DTO for short), or may be in another form, which is not limited in this embodiment.
Specifically, in this embodiment, after receiving the backend service data, the service identification information corresponding to the backend service data may be obtained, and the data processing policy matched with the backend service data is determined according to the service identification information. Or, other ways may also be used to determine the data processing policy matched with the backend service data, which is not limited in this embodiment.
And 103, processing the back-end service data according to the data processing strategy to obtain the front-end data to be displayed.
In this embodiment, although the back-end service data and the corresponding front-end data to be displayed are in the same service, the attribute name of the back-end service data may be different from the attribute name of the front-end data to be displayed, and/or the attribute type of the back-end service data may also be different from the attribute type of the front-end data to be displayed. And/or the data to be displayed at the front end is obtained by the back-end service data through operation.
Taking the service as an order query service as an example, a mode of processing the back-end service data and the front-end data to be displayed and the back-end service data according to the data processing strategy is exemplified.
In the order query service, the order query result data provided by the back-end application layer is back-end service data, and the back-end service data comprises the following data: order flow number, trade name, order creation time. The attribute name of the order serial number is order number1, and the attribute type is integer. The attribute names of the trade names are: and goods, the attribute type is an object structure. Attribute names of order creation time: and the attribute type is integer type. And the corresponding front-end data to be displayed only comprises: order flow number and trade name. And the attribute name of the order serial number is order number2, the attribute name of the trade name is goods, and the attribute type is an array structure. The data processing policy of the order query service includes attribute information of the order serial number and the trade name, a conversion policy of converting the order serial number in the back-end service data into the order serial number of the front-end data to be displayed, and a conversion policy of converting the trade name in the back-end service data into the trade name of the front-end data to be displayed. The conversion strategy for converting the order serial number in the back-end service data into the order serial number of the front-end data to be displayed is to convert the attribute name and the attribute type of the order serial number in the back-end service data into the attribute name and the attribute type of the order serial number of the front-end data to be displayed. The conversion policy of the trade name in the back-end service data to the trade name of the front-end data to be displayed is to convert the attribute type of the trade name in the back-end service data to the attribute type of the trade name of the front-end data to be displayed.
In this embodiment, first, attribute information of the order serial number of the data to be displayed at the front end is obtained, then the attribute information of the order serial number in the back-end service data is converted into attribute information of the order serial number in the data to be displayed at the front end according to the conversion policy, then attribute information of the trade name of the data to be displayed at the front end is obtained, and then the attribute type of the trade name in the back-end service data is converted into the attribute type of the trade name in the data to be displayed at the front end according to the conversion policy. To obtain the data to be displayed at the front end.
The data to be displayed at the front end may be stored by using a JSON object, or stored by using other manners, which is not limited in this embodiment.
And 104, sending the front-end data to be displayed to a front-end application layer so as to display the front-end data to be displayed.
In this embodiment, the data to be displayed at the front end is sent to the front-end application layer, and the front-end application layer displays the data to be displayed at the front end according to the attribute name and the attribute type of the data to be displayed at the front end.
In the data processing method based on the application program provided by this embodiment, the back-end service data sent by the back-end application layer is received, and the back-end service data corresponds to the service request sent by the front-end application layer; determining a data processing strategy matched with the back-end service data, wherein the data processing strategy comprises attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion strategy for converting the back-end service data into the front-end data to be displayed; processing the back-end service data according to the data processing strategy to obtain front-end data to be displayed; and sending the data to be displayed at the front end to a front-end application layer so as to display the data to be displayed at the front end. Because the attribute information of the pre-defined front-end data to be displayed comprises the attribute type of the front-end data to be displayed, the data structure of the front-end data to be displayed can be obtained, and after the data processing layer is established, the change of the back-end service data can unify the front-end data to be displayed in the process of converting the back-end service data into the front-end data to be displayed on the data processing layer, so that the problem of pollution caused by the transmission of the data at the front end and the back end can be avoided, and the difficulty of maintaining and upgrading the application program is effectively reduced.
Example two
Fig. 3 is a schematic diagram of a second system architecture capable of implementing the data processing method of the application program according to the embodiment of the present invention, as shown in fig. 3, in the system architecture diagram of the application program provided in this embodiment, a data processing layer is mounted in a node. And the functional logic layer is also mounted in a node. And the whole system of the application program is programmed by JavaScript language.
Fig. 4 is a schematic flowchart of a data processing method based on an application program according to another embodiment of the present invention, and as shown in fig. 4, the data processing method based on an application program according to this embodiment further refines steps 102 to 104 on the basis of the data processing method based on an application program according to the embodiment of the present invention shown in fig. 2, and further includes steps of constructing a backend data transmission object, a front-end data transmission object, and constructing a mapping relationship between the backend data transmission object and the front-end data transmission object corresponding to each service. The data processing method based on the application program provided by the embodiment includes the following steps:
step 201, a backend data transmission object corresponding to each service in the backend application layer is constructed.
In this embodiment, for each service in the backend application layer, a corresponding backend data transport object may be constructed. Attribute information of at least one back-end service data is stored in the back-end data transport object of each service. Wherein the attribute information includes: attribute name and attribute type.
Optionally, in this embodiment, step 201 includes the following steps:
in step 2011, the first attribute name and the first attribute type of the backend service data of each service in the backend application layer are determined.
Specifically, in this embodiment, for each service in the backend application layer, backend service data may be acquired from the corresponding interface. The number of the backend service data corresponding to each service may be one or more. And determining the attribute name and the attribute type of each piece of back-end service data according to the obtained back-end service data.
The attribute name of the back-end service data is a first attribute name, and the attribute type of the back-end service data is a first attribute type.
The first attribute type may be a character type, an integer type, a single-precision type, a double-precision type, an array type, or the like.
Step 2012, the first attribute name and the first attribute type are formed into a first key-value pair.
Specifically, in this embodiment, for each backend service data in each service, a key-value pair is formed by a first attribute name of each backend service data and a corresponding first attribute type, and the key-value pair is a first key-value pair.
The first attribute name is represented as a key in the first key value pair, and the first attribute type is represented as a value in the first key value pair.
Step 2013, constructing a corresponding back-end data transmission object according to the first key value pair corresponding to the back-end service data.
Specifically, the first key value pair corresponding to each backend service data in each service may be stored according to the acquisition order of each backend service data in each service, so as to form a corresponding backend data transmission object.
It will be appreciated that the backend data transport object corresponding to each service in the backend application layer is stored in the data processing layer.
In this embodiment, when a backend data transmission object corresponding to each service in the backend application layer is constructed, the attribute information of the backend service data is stored by using the first key value, so that the data structure of the backend service data can be efficiently obtained when the application program is maintained and updated, and the difficulty in maintaining and updating the application program is further reduced.
Step 202, front-end data transmission objects corresponding to the services in the back-end application layer are constructed.
In this embodiment, the data processing policy in the data processing layer is represented by a front-end data transmission object, so that a front-end data transmission object corresponding to each service in the back-end application layer is constructed. The number of the data to be presented at the front end in the front end data transmission object corresponding to each service may be one or more.
Optionally, in this embodiment, step 202 includes the following steps:
step 2021, obtaining display information of the front-end to-be-displayed data of each service in the back-end application layer.
In this embodiment, in the development process of the front-end application layer, a front-end developer may design and store the display information of the front-end data to be displayed corresponding to each service. The display information comprises the number, name, data structure and display effect of the data to be displayed at the front end. Therefore, the display information of the data to be displayed at the front end corresponding to each service can be acquired from the corresponding storage area.
Step 2022, construct the second attribute information of the front-end data to be displayed in the corresponding front-end data transmission object according to the display information.
Optionally, in this embodiment, the step 2022 includes the following steps:
step 2022a, determining a second attribute name and a second attribute type of the corresponding front-end data to be displayed according to the display information.
Step 2022b, form the second key-value pair from the second attribute name and the second attribute type.
Step 2022c, determining the second key-value pair as the second attribute information of the front end data to be displayed in the corresponding front end data transmission object.
Specifically, in this embodiment, the name and the data structure of the data to be displayed at each front end in each service may be obtained according to the display information of each service. And determining the name of each front-end data to be displayed as a corresponding attribute name, wherein the attribute name is a second attribute name. And determining the data structure of each front-end data to be displayed as a corresponding attribute type, wherein the attribute type is a second attribute type. And forming a corresponding key value pair by the attribute name and the attribute type of each front-end data to be displayed, wherein the key value pair is a second key value pair. And determining the second key value pair as attribute information corresponding to the data to be displayed at the front end, wherein the attribute information is second attribute information.
It can be understood that the second attribute name of the front-end data to be presented and the first attribute name of the corresponding back-end service data may be the same or different. Similarly, the second attribute type of the data to be displayed at the front end and the first attribute type of the corresponding back-end service data may be the same or different. If the attribute names and/or the attribute types are different, the corresponding conversion strategies are required to be converted.
Step 2023, obtain the first attribute information of the back-end service data corresponding to the front-end data to be displayed.
In this embodiment, each piece of front-end data to be displayed and each piece of back-end service data may have identification information, and then the back-end service data corresponding to each piece of front-end data to be displayed may be obtained according to the identification information, and the first attribute information of the corresponding back-end service data may be obtained.
Step 2024, construct the conversion policy in the corresponding front-end data transmission object according to the first attribute information and the corresponding second attribute information.
Specifically, in this embodiment, the first attribute information of each front-end data to be displayed is compared with the corresponding second attribute information, a difference and a conversion relationship between the first attribute information and the second attribute information are determined, and a conversion policy in the corresponding front-end data transmission object is constructed according to the difference and the conversion relationship.
In this embodiment, the second attribute information of the front-end data to be displayed in the corresponding front-end data transmission object is constructed according to the display information of the front-end data to be displayed of each service, and the display information can accurately express the display state of the front-end data to be displayed, so that the constructed second attribute information of the front-end data to be displayed is more accurate. And the conversion strategy can be accurately determined according to the first attribute information of the back-end service data and the second attribute information of the corresponding front-end data to be displayed.
Step 2025, determine whether the corresponding front end data transmission object includes the dependent item according to the presentation information.
In this embodiment, the dependency item in the front-end data transmission object is a dependency data transmission object, which may be referred to as a dependency DTO for short.
In this embodiment, if each piece of front-end data to be displayed in the display information of the front-end data to be displayed in a certain service is a dependency relationship, it indicates that the front-end data transmission object includes a dependency DTO. The dependency relationship may be a hierarchical relationship, an association relationship, or the like.
For example, in a certain address obtaining service, the display information of the data to be displayed at the front end includes a provincial address, a city address and a district address, but the provincial address, the city address and the district address are in a hierarchical relationship, and if the attribute information of the provincial address and the corresponding conversion policy are stored in the front end data transmission object corresponding to the address obtaining service, the DTO includes a DTO corresponding to the city address and a DTO corresponding to the district address. In particular the dependency may be represented as shown in fig. 5. In fig. 5, representation information, i.e. id information, of the front-end data transfer object may also be included.
At step 2026, if it is determined that a dependent item is included, the dependent item is added to the corresponding front end data transport object.
In this embodiment, if it is determined that the front-end data transmission object includes the dependent DTO, the dependent DTO is also added to the corresponding front-end data transmission object. As in the above exemplary description, the DTO corresponding to the city level address and the DTO corresponding to the district level address are added to the front end data transfer object corresponding to the provincial level address.
Step 203, constructing a mapping relationship between the back-end data transmission object and the front-end data transmission object corresponding to each service.
Optionally, in this embodiment, step 203 includes the following steps:
step 2031, for each service, obtaining a first key-value pair corresponding to each back-end service data in the back-end data transmission object, and obtaining a second key-value pair corresponding to each front-end to-be-displayed data in the corresponding front-end data transmission object.
And the number of the back-end service data corresponding to each service and the number of the front-end data to be displayed corresponding to each service are at least one. It can be understood that the amount of the backend service data corresponding to each service and the amount of the data to be presented at the front end may be different.
Specifically, in this embodiment, a first key value pair corresponding to each piece of backend service data in the backend data transmission object is obtained, and a second key value pair corresponding to each piece of front-end to-be-displayed data in the corresponding front-end data transmission object is obtained. Because each back-end service data and the front-end data to be displayed have corresponding identification information, the meaning of the data represented by the first key value pair corresponding to each back-end service data can be determined. And the meaning of the data represented by the second key-value pair corresponding to each front-end data to be presented in the front-end data transmission object can be determined.
Step 2032, a mapping relationship between the first key-value pair and the corresponding second key-value pair is established.
In this embodiment, if the identification information of the back-end service data is the same as the identification information of the front-end data to be displayed and indicates the same meaning, the mapping relationship between the first key-value pair and the corresponding second key-value pair with the same identification information is directly constructed. If it is determined that there is no front-end data to be displayed related to the back-end service data according to the identification information of the back-end service data, it is not necessary to construct a mapping relationship between the first key-value pair of the back-end service data and the second key-value pair of the front-end data to be displayed. If it is determined that there is front-end data to be displayed related to the back-end service data according to the identification information of the back-end service data, but the front-end data to be displayed needs to be obtained by converting at least one back-end service data, a mapping relation between a first key value pair of at least one back-end service data and the front-end data to be displayed is constructed.
It can be understood that, if the data to be presented at the front end needs to be obtained by converting at least one back-end service data, the attribute type of the front-end presentation data stored in the front-end data transmission object corresponding to the front-end presentation data is a method body.
In the embodiment of the invention, when the mapping relation between the back-end data transmission object and the front-end data transmission object corresponding to each service is established, the mapping relation between the first key value pair corresponding to each back-end service data and the second key value pair corresponding to the front-end data to be displayed is established, so that the mapping relation between each data attribute information in the back-end data transmission object and the front-end data transmission object can be established more accurately, and the converted front-end data to be displayed is more accurate.
Step 204, receiving the back-end service data sent by the back-end application layer, where the back-end service data corresponds to the service request sent by the front-end application layer.
In this embodiment, as shown in fig. 6, the received backend service data sent by the backend application layer may be represented in the leftmost table in fig. 6, where the backend service data includes four data. Respectively, keys 1 through key 4.
Step 205, determining a data processing policy matched with the back-end service data, where the data processing policy includes attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion policy for converting the back-end service data into the front-end data to be displayed.
Wherein the data processing strategy is represented by a front-end data transmission object. Then in the front end data transport object include: attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion strategy for converting the back-end service data into the front-end data to be displayed. Dependent DTOs may also be included in the front-end data transport object.
Optionally, step 205 comprises the steps of:
step 2051, determine the backend data transport object that matches the backend service data.
Specifically, each service may have corresponding service identification information, and after the backend data transmission object is constructed, the service identification information and the backend data transmission object may be stored in an associated manner. It can be determined whether the backend service data has a matching backend data transmission object according to the service identification information.
Step 2052 obtains the front end data transport object having a mapping relationship with the back end data transport object.
Step 2053, determine the front-end data transmission object with mapping relation as the data processing policy matched with the back-end service data.
Specifically, in this embodiment, a mapping relationship between the backend data transmission object and the front-end data transmission object may be obtained, a front-end data transmission object having a mapping relationship with the matched backend data transmission object is obtained, and the front-end data transmission object having the mapping relationship is determined as a data processing policy matched with the backend service data.
And step 206, processing the back-end service data according to the data processing strategy to obtain the front-end data to be displayed.
Optionally, in this embodiment, step 206 includes the following steps:
step 2061, obtaining attribute information of the front-end data to be displayed corresponding to the back-end service data according to the front-end data transmission object.
In this embodiment, as shown in the middle table of fig. 6, a front-end data transmission object matched with the back-end service data is shown, and exemplarily, attribute information of three front-end data to be exposed is included in the front-end data transmission object. Attribute information of keys 1 to key3, respectively. Wherein the attribute type of the key1 is character type. The attribute type of Key is numerical type, and the attribute type of Key3 is method body. The back-end service data corresponding to the front-end to-be-shown data key1 is key 1. The back-end service data corresponding to the front-end to-be-shown data key2 is key 2. The back-end service data corresponding to the front-end to-be-shown data key3 are key3 and key 4. The method body is the value after the back end service data key3 and key4 are merged.
Step 2062, if the attribute type in the attribute information is a preset data type, reading a return value under the attribute name corresponding to the corresponding back-end service data, and converting the return value into the preset data type according to the conversion strategy, so as to obtain an output value under the attribute name corresponding to the front-end data to be displayed.
The preset data type is other types except for the method body, and the preset data type may include: character type, integer type, single precision type, double precision type, array type, etc.
Step 2063, if the attribute type in the attribute information is the method body type, reading a return value under the attribute name corresponding to the corresponding back-end service data, and inputting the return value into the method body to obtain an output value under the attribute name corresponding to the front-end data to be displayed.
Specifically, in this embodiment, the attribute information of the first front-end data to be displayed of the front-end data transmission object is read, whether value in the second key value pair of the attribute information is a preset attribute type is determined, if yes, a return value corresponding to an attribute name key in the back-end service data is read, and the return value is converted into an attribute type defined by the value according to a conversion policy, so as to obtain an output value corresponding to the attribute name of the first front-end data to be displayed. And if the type of the method body is the type of the method body, reading a return value under the attribute name key corresponding to the corresponding back-end service data, inputting the return value into the method body, executing the method in the method body, and obtaining the corresponding return value, wherein the return value is an output value under the attribute name corresponding to the front-end data to be displayed.
After the output value under the attribute name corresponding to the first front-end data to be displayed is obtained, the key in the temporary object can be assigned for storage.
And then judging whether the front-end data transmission object comprises next front-end data to be displayed, if so, still judging whether the value in the second key value pair of the attribute information is a preset attribute type or a method body type, obtaining an output value under the attribute name corresponding to the next front-end data to be displayed according to the attribute type in the corresponding value, and storing the output value into a temporary object until all the front-end data to be displayed in the front-end data transmission object obtain the output value.
The exemplary description of steps 2062-2063 continues with fig. 6. If the attribute type of the front-end to-be-presented data key1 is a character type (string), the return value under the read back-end service data key1 is a "test case", and the return value is converted into the character type according to the conversion strategy, so as to obtain the output value under the attribute name corresponding to the front-end to-be-presented data key1 as the "test case". If the attribute type of the front-end to-be-displayed data key2 is a numerical type (number), the return value under the back-end service data key1 is read to be "999", and the return value is converted into the numerical type according to the conversion policy, so that the output value under the attribute name corresponding to the front-end to-be-displayed data key1 is obtained to be "999". If the attribute type of the front-end to-be-presented data key3 is a method body, the return values read under the back-end service data key3 and the key4 are Hello and World, respectively, and the return values are converted into the method body type according to the conversion strategy, so that the output value under the attribute name corresponding to the front-end to-be-presented data key3 is Hello World.
Step 2064, constructing a corresponding JSON object according to the attribute name and the output value corresponding to the front-end data to be displayed, so as to obtain the front-end data to be displayed.
In this embodiment, since the output value of the attribute name corresponding to the data to be presented at the front end is stored in the temporary object, a JSON object is newly created, the output value is obtained from the temporary object, the attribute name and the output value corresponding to the data to be presented at the front end are stored in the JSON object, and the data stored in the JSON object is the data to be presented at the front end.
And step 207, sending the data to be displayed at the front end to the functional logic layer, so that the functional logic layer renders the data to be displayed at the front end and sends the rendered data to the front-end application layer.
Optionally, as shown in fig. 3, a functional logic layer is established between the data processing layer and the front-end application layer, and the functional logic layer is configured to receive the front-end data to be displayed from the data processing layer, perform rendering processing on the front-end data to be displayed, and send the rendered front-end data to the front-end application layer, so that the front-end application layer receives the rendered front-end data to be displayed and then displays the rendered front-end data according to a rendering processing result.
It will be appreciated that the front-end application layer may not pass through the functional logic layer when sending service requests to the data processing layer.
In the embodiment, the functional logic layer is constructed between the data processing layer and the front-end application layer, and after the data to be displayed at the front end is determined by the data processing layer, the data to be displayed at the front end is rendered through the functional logic layer, so that when the data to be displayed at the front end is displayed by the front-end application layer, the display requirement is met, and the experience of a user in using the application program is improved.
EXAMPLE III
Fig. 7 is a schematic structural diagram of an application-based data processing apparatus according to an embodiment of the present invention, and as shown in fig. 7, the application-based data processing apparatus according to this embodiment is located in a data processing layer, and the data processing layer is located between a front-end application layer and a back-end application layer, then the application-based data processing apparatus 70 according to this embodiment includes: a data receiving module 71, a processing strategy determining module 72, a data processing module 73 and a data sending module 74.
The data receiving module 71 is configured to receive backend service data sent by a backend application layer, where the backend service data corresponds to a service request sent by a front-end application layer. And a processing policy determining module 72, configured to determine a data processing policy matched with the back-end service data, where the data processing policy includes attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion policy for converting the back-end service data into the front-end data to be displayed. And the data processing module 73 is configured to process the back-end service data according to the data processing policy to obtain front-end data to be displayed. And the data sending module 74 is configured to send the front-end data to be displayed to the front-end application layer, so as to display the front-end data to be displayed.
The data processing based on the application program provided in this embodiment may execute the technical solution of the method embodiment shown in fig. 2, and the implementation principle and the technical effect thereof are similar to those of the method embodiment shown in fig. 2, and are not described in detail herein.
Example four
Fig. 8 is a schematic structural diagram of an application-based data processing apparatus according to another embodiment of the present invention, and as shown in fig. 8, an application-based data processing apparatus 80 according to this embodiment further includes, on the basis of the application-based data processing apparatus 70 provided in fig. 7: a module 81 is constructed.
Optionally, the data processing layer is installed in a node. Accordingly, the processing policy determining module 72 is specifically configured to:
determining a backend data transmission object matched with the backend service data; acquiring a front-end data transmission object having a mapping relation with a back-end data transmission object; and determining the front-end data transmission object with the mapping relation as a data processing strategy matched with the back-end service data.
Optionally, a building block 81, configured to:
constructing a back-end data transmission object corresponding to each service in a back-end application layer; constructing a front-end data transmission object corresponding to each service in a front-end application layer; and constructing a mapping relation between the back-end data transmission object and the front-end data transmission object corresponding to each service.
Optionally, the building module 81 is specifically configured to, when building a backend data transmission object corresponding to each service in the backend application layer:
determining a first attribute name and a first attribute type of back-end service data of each service in a back-end application layer; forming a first key-value pair by the first attribute name and the first attribute type; and constructing a corresponding back-end data transmission object according to the first key value pair corresponding to the back-end service data.
Optionally, the building module, when building a front-end data transmission object corresponding to each service in the back-end application layer, is specifically configured to:
acquiring display information of front-end data to be displayed of each service in a rear-end application layer; constructing second attribute information of front-end data to be displayed in the corresponding front-end data transmission object according to the display information; acquiring first attribute information of back-end service data corresponding to front-end data to be displayed; and constructing a conversion strategy in the corresponding front-end data transmission object according to the first attribute information and the corresponding second attribute information.
Optionally, the building module 81 is further configured to:
judging whether the corresponding front-end data transmission object comprises a dependent item or not according to the display information; if it is determined that a dependent item is included, the dependent item is added to the corresponding front-end data transport object.
Optionally, the constructing module 81, when constructing the second attribute information of the front-end data to be displayed in the corresponding front-end data transmission object according to the display information, is specifically configured to:
determining a second attribute name and a second attribute type of the corresponding front-end data to be displayed according to the display information; forming a second key value pair by the second attribute name and the second attribute type; and determining the second key value pair as second attribute information of the front end data to be displayed in the corresponding front end data transmission object.
Optionally, at least one of the back-end service data corresponding to each service and the corresponding front-end data to be displayed is provided, and accordingly, the constructing module 81 is specifically configured to, when constructing the mapping relationship between the back-end data transmission object and the front-end data transmission object corresponding to each service: for each service, acquiring a first key value pair corresponding to each back-end service data in a back-end data transmission object, and acquiring a second key value pair corresponding to each front-end to-be-displayed data in a corresponding front-end data transmission object; and constructing a mapping relation between the first key-value pair and the corresponding second key-value pair.
Optionally, the data processing module 73 is specifically configured to:
acquiring attribute information of front-end data to be displayed corresponding to the back-end service data according to the front-end data transmission object; if the attribute type in the attribute information is a preset attribute type, reading a return value under the attribute name corresponding to the corresponding back-end service data, and converting the return value into the preset attribute type according to a conversion strategy so as to obtain an output value under the attribute name corresponding to the front-end data to be displayed; if the attribute type in the attribute information is the method body type, reading a return value under the attribute name corresponding to the corresponding back-end service data, and inputting the return value into the method body to obtain an output value under the attribute name corresponding to the front-end data to be displayed; and constructing a corresponding JSON object according to the attribute name and the output value corresponding to the front-end data to be displayed so as to obtain the front-end data to be displayed.
Optionally, the data sending module 74 is specifically configured to send the data to be displayed at the front end to the functional logic layer, so that the functional logic layer performs rendering processing on the data to be displayed at the front end and sends the data to the front-end application layer.
The data processing apparatus based on the application program provided in this embodiment may execute the technical solution of the method embodiment shown in fig. 4, and the implementation principle and the technical effect thereof are similar to those of the method embodiment shown in fig. 4, and are not described in detail herein.
EXAMPLE five
FIG. 9 is a first block diagram of an electronic device for implementing an application-based data method of an embodiment of the present invention. As shown in fig. 9, the electronic device 900 includes: memory 901, processor 902.
A memory 901; a memory for storing processor-executable instructions.
Wherein the processor 902 is configured to be able to perform the method of either of the two embodiments described above.
EXAMPLE six
Fig. 10 is a second block diagram of an electronic device, which may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, etc., for implementing an application-based data method of an embodiment of the present invention.
Among other things, the electronic device 1000 may include one or more of the following components: processing component 1002, memory 1004, power component 1006, multimedia component 1008, audio component 1010, input/output (I/O) interface 1012, sensor component 1014, and communications component 1016.
The processing component 1002 generally controls overall operation of the electronic device 1000, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 1002 may include one or more processors 1020 to execute instructions to perform all or a portion of the steps of the methods described above. Further, processing component 1002 may include one or more modules that facilitate interaction between processing component 1002 and other components. For example, processing component 1002 can include a multimedia module to facilitate interaction between multimedia component 10010 and processing component 1002.
The memory 1004 is configured to store various types of data to support operations at the electronic device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1004 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 1006 provides power to the various components of the electronic device 1000. The power components 1006 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 1000.
The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 1000 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1010 is configured to output and/or input audio signals. For example, the audio component 1010 may include a Microphone (MIC) configured to receive external audio signals when the electronic device 1000 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1004 or transmitted via the communication component 1016. In some embodiments, audio component 1010 also includes a speaker for outputting audio signals.
I/O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 1014 may detect an open/closed state of the electronic device 1000, a relative positioning of components, such as a display and keypad of the electronic device 1000, a change in position of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of user contact with the electronic device 1000, an orientation or acceleration/deceleration of the electronic device 1000, and a change in temperature of the electronic device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1014 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1016 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 1000 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 1004 comprising instructions, executable by the processor 1020 of the electronic device 1000 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium, in which instructions, when executed by a processor of an electronic device, enable a terminal device to perform an application-based data method of the electronic device.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (20)

1. An application-based data processing method, applied to a data processing layer, the data processing layer being located between a front-end application layer and a back-end application layer, the method comprising:
receiving back-end service data sent by the back-end application layer, wherein the back-end service data corresponds to a service request sent by a front-end application layer;
determining a data processing strategy matched with the back-end service data, wherein the data processing strategy comprises attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion strategy for converting the back-end service data into the front-end data to be displayed;
processing the back-end service data according to the data processing strategy to obtain front-end data to be displayed;
and sending the front-end data to be displayed to a front-end application layer so as to display the front-end data to be displayed.
2. The method of claim 1, wherein the data processing layer is hosted in a node.js runtime environment, and the data processing policy is represented using a front-end data transport object;
the determining the data processing policy matched with the backend service data includes:
determining a backend data transmission object matched with the backend service data;
acquiring a front-end data transmission object having a mapping relation with the back-end data transmission object;
and determining the front-end data transmission object with the mapping relation as a data processing strategy matched with the back-end service data.
3. The method of claim 2, wherein prior to determining the data processing policy that matches the backend service data, further comprising:
constructing a back-end data transmission object corresponding to each service in the back-end application layer;
constructing a front-end data transmission object corresponding to each service in the back-end application layer;
and constructing a mapping relation between the back-end data transmission object and the front-end data transmission object corresponding to each service.
4. The method of claim 3, wherein constructing a backend data transport object corresponding to each service in the backend application layer comprises:
determining a first attribute name and a first attribute type of back-end service data of each service in the back-end application layer;
forming a first key-value pair by the first attribute name and the first attribute type;
and constructing a corresponding back-end data transmission object according to the first key value pair corresponding to the back-end service data.
5. The method of claim 3, wherein constructing a front-end data transport object corresponding to each service in the back-end application layer comprises:
acquiring display information of front-end data to be displayed of each service in the back-end application layer;
constructing second attribute information of front-end data to be displayed in the corresponding front-end data transmission object according to the display information;
acquiring first attribute information of back-end service data corresponding to front-end data to be displayed;
and constructing a conversion strategy in the corresponding front-end data transmission object according to the first attribute information and the corresponding second attribute information.
6. The method of claim 5, further comprising:
judging whether the corresponding front-end data transmission object comprises a dependent item or not according to the display information;
if it is determined that a dependent item is included, the dependent item is added to the corresponding front-end data transport object.
7. The method according to claim 5, wherein said constructing second attribute information of front-end data to be exposed in the corresponding front-end data transmission object according to the exposure information comprises:
determining a second attribute name and a second attribute type of corresponding front-end data to be displayed according to the display information;
forming a second key-value pair by the second attribute name and the second attribute type;
and determining the second key value pair as second attribute information of the front end data to be displayed in the corresponding front end data transmission object.
8. The method according to claim 3, wherein at least one of the backend service data corresponding to each service and the corresponding data to be presented at the front end is provided;
the constructing of the mapping relationship between the back-end data transmission object and the front-end data transmission object corresponding to each service includes:
for each service, acquiring a first key value pair corresponding to each back-end service data in a back-end data transmission object, and acquiring a second key value pair corresponding to each front-end to-be-displayed data in a corresponding front-end data transmission object;
and constructing a mapping relation between the first key-value pair and the corresponding second key-value pair.
9. The method according to claim 2, wherein the processing the backend service data according to the data processing policy to obtain front-end data to be presented comprises:
acquiring attribute information of front-end data to be displayed corresponding to the back-end service data according to the front-end data transmission object;
if the attribute type in the attribute information is a preset attribute type, reading a return value under the attribute name corresponding to the corresponding back-end service data, and converting the return value into the preset attribute type according to a conversion strategy so as to obtain an output value under the attribute name corresponding to the front-end data to be displayed;
if the attribute type in the attribute information is a method body type, reading a return value under the attribute name corresponding to the corresponding back-end service data, and inputting the return value into a method body to obtain an output value under the attribute name corresponding to the front-end data to be displayed;
and constructing a corresponding JSON object according to the attribute name and the output value corresponding to the front-end data to be displayed so as to obtain the front-end data to be displayed.
10. The method according to any one of claims 1 to 9, wherein the sending the front-end data to be presented to a front-end application layer comprises:
and sending the data to be displayed at the front end to a functional logic layer so that the functional logic layer renders the data to be displayed at the front end and sends the data to the front end application layer.
11. An application-based data processing apparatus, the apparatus being located at a data processing layer, the data processing layer being located between a front-end application layer and a back-end application layer, the apparatus comprising:
the data receiving module is used for receiving back-end service data sent by the back-end application layer, wherein the back-end service data corresponds to a service request sent by the front-end application layer;
the processing strategy determining module is used for determining a data processing strategy matched with the back-end service data, wherein the data processing strategy comprises attribute information of front-end data to be displayed corresponding to the back-end service data and a conversion strategy for converting the back-end service data into the front-end data to be displayed;
the data processing module is used for processing the back-end service data according to the data processing strategy so as to obtain front-end data to be displayed;
and the data sending module is used for sending the front-end data to be displayed to a front-end application layer so as to display the front-end data to be displayed.
12. The apparatus of claim 11, wherein the data processing layer is hosted in a node.js runtime environment, and wherein the data processing policy is represented using a front-end data transport object;
the processing policy determination module is specifically configured to:
determining a backend data transmission object matched with the backend service data; acquiring a front-end data transmission object having a mapping relation with the back-end data transmission object; and determining the front-end data transmission object with the mapping relation as a data processing strategy matched with the back-end service data.
13. The apparatus of claim 12, further comprising: a build module to:
constructing a back-end data transmission object corresponding to each service in the back-end application layer; constructing a front-end data transmission object corresponding to each service in the back-end application layer; and constructing a mapping relation between the back-end data transmission object and the front-end data transmission object corresponding to each service.
14. The apparatus of claim 13, wherein the building module, when building a backend data transport object corresponding to each service in the backend application layer, is specifically configured to:
determining a first attribute name and a first attribute type of back-end service data of each service in the back-end application layer; forming a first key-value pair by the first attribute name and the first attribute type; and constructing a corresponding back-end data transmission object according to the first key value pair corresponding to the back-end service data.
15. The apparatus of claim 13, wherein the building module, when building the front-end data transport object corresponding to each service in the back-end application layer, is specifically configured to:
acquiring display information of front-end data to be displayed of each service in the front-end application layer; constructing second attribute information of front-end data to be displayed in the corresponding front-end data transmission object according to the display information; acquiring first attribute information of back-end service data corresponding to front-end data to be displayed; and constructing a conversion strategy in the corresponding front-end data transmission object according to the first attribute information and the corresponding second attribute information.
16. The apparatus of claim 15, wherein the build module is further configured to:
judging whether the corresponding front-end data transmission object comprises a dependent item or not according to the display information; if it is determined that a dependent item is included, the dependent item is added to the corresponding front-end data transport object.
17. The apparatus according to claim 12, wherein the data processing module is specifically configured to:
acquiring attribute information of front-end data to be displayed corresponding to the back-end service data according to the front-end data transmission object; if the attribute type in the attribute information is a preset attribute type, reading a return value under the attribute name corresponding to the corresponding back-end service data, and converting the return value into the preset attribute type according to a conversion strategy so as to obtain an output value under the attribute name corresponding to the front-end data to be displayed; if the attribute type in the attribute information is a method body type, reading a return value under the attribute name corresponding to the corresponding back-end service data, and inputting the return value into a method body to obtain an output value under the attribute name corresponding to the front-end data to be displayed; and constructing a corresponding JSON object according to the attribute name and the output value corresponding to the front-end data to be displayed so as to obtain the front-end data to be displayed.
18. The apparatus according to any one of claims 11-17,
the data sending module is specifically configured to send the front-end data to be displayed to a functional logic layer, so that the functional logic layer performs rendering processing on the front-end data to be displayed and sends the front-end data to the front-end application layer.
19. An electronic device, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to be capable of performing the method of any one of claims 1-10.
20. A computer-readable storage medium having computer-executable instructions stored therein, which when executed by a processor, are configured to implement the method of any one of claims 1-10.
CN202010720879.2A 2020-07-24 2020-07-24 Data processing method, device, equipment and storage medium based on application program Active CN112256445B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010720879.2A CN112256445B (en) 2020-07-24 2020-07-24 Data processing method, device, equipment and storage medium based on application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010720879.2A CN112256445B (en) 2020-07-24 2020-07-24 Data processing method, device, equipment and storage medium based on application program

Publications (2)

Publication Number Publication Date
CN112256445A true CN112256445A (en) 2021-01-22
CN112256445B CN112256445B (en) 2024-06-18

Family

ID=74223982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010720879.2A Active CN112256445B (en) 2020-07-24 2020-07-24 Data processing method, device, equipment and storage medium based on application program

Country Status (1)

Country Link
CN (1) CN112256445B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113391867A (en) * 2021-06-16 2021-09-14 杨永飞 Big data service processing method and service server based on digitization and visualization

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140122996A1 (en) * 2012-10-26 2014-05-01 Kapil Gupta Method, system, and program for automatic generation of screens for mobile apps based on back-end services
WO2016177250A1 (en) * 2015-05-05 2016-11-10 阿里巴巴集团控股有限公司 Client page rendering method and apparatus
CN107168971A (en) * 2016-03-07 2017-09-15 阿里巴巴集团控股有限公司 The data processing method and device of web application
CN108733499A (en) * 2018-05-28 2018-11-02 北京京东金融科技控股有限公司 Browser page display data processing method and processing device
CN110704481A (en) * 2018-06-25 2020-01-17 北京京东尚科信息技术有限公司 Method and device for displaying data
CN111324833A (en) * 2018-12-14 2020-06-23 北京京东尚科信息技术有限公司 Page display method, device, electronic design and computer readable medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140122996A1 (en) * 2012-10-26 2014-05-01 Kapil Gupta Method, system, and program for automatic generation of screens for mobile apps based on back-end services
WO2016177250A1 (en) * 2015-05-05 2016-11-10 阿里巴巴集团控股有限公司 Client page rendering method and apparatus
CN107168971A (en) * 2016-03-07 2017-09-15 阿里巴巴集团控股有限公司 The data processing method and device of web application
CN108733499A (en) * 2018-05-28 2018-11-02 北京京东金融科技控股有限公司 Browser page display data processing method and processing device
CN110704481A (en) * 2018-06-25 2020-01-17 北京京东尚科信息技术有限公司 Method and device for displaying data
CN111324833A (en) * 2018-12-14 2020-06-23 北京京东尚科信息技术有限公司 Page display method, device, electronic design and computer readable medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113391867A (en) * 2021-06-16 2021-09-14 杨永飞 Big data service processing method and service server based on digitization and visualization

Also Published As

Publication number Publication date
CN112256445B (en) 2024-06-18

Similar Documents

Publication Publication Date Title
CN111026396B (en) Page rendering method and device, electronic equipment and storage medium
CN109032606B (en) Native application compiling method and device and terminal
CN107423106B (en) Method and apparatus for supporting multi-frame syntax
CN110990075B (en) Method, device, equipment and storage medium for starting fast application
US10909203B2 (en) Method and device for improving page display effect via execution, conversion and native layers
CN109542417B (en) Method, device, terminal and storage medium for rendering webpage through DOM
CN109710259B (en) Data processing method, device and storage medium
US10606477B1 (en) Intelligent keyboard
CN107463372B (en) Data-driven page updating method and device
US11210449B2 (en) Page display method and device and storage medium
CN111221613B (en) Program calling method and device and storage medium
CN111695064B (en) Buried point loading method and device
CN112256445B (en) Data processing method, device, equipment and storage medium based on application program
CN111382161B (en) State data processing method and device, electronic equipment and storage medium
CN110908629A (en) Electronic equipment operation method and device, electronic equipment and storage medium
CN112486617B (en) Ciphertext data processing architecture, method, apparatus and machine readable medium
CN105630948A (en) Web page display method and apparatus
CN112862349B (en) Data processing method, device and equipment based on ABS service data
CN110457084B (en) Loading method and device
CN110989987B (en) Portal webpage generation method and device, client, server and storage medium
CN113128181A (en) Information processing method and device
CN113378022A (en) In-station search platform, search method and related device
CN113535161A (en) User interface generation method and device
CN112732734A (en) Information processing method and device
CN112182449A (en) Page loading method and device, electronic equipment and storage medium

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