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

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

Info

Publication number
CN112256445B
CN112256445B CN202010720879.2A CN202010720879A CN112256445B CN 112256445 B CN112256445 B CN 112256445B CN 202010720879 A CN202010720879 A CN 202010720879A CN 112256445 B CN112256445 B CN 112256445B
Authority
CN
China
Prior art keywords
data
displayed
service
transmission object
data transmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010720879.2A
Other languages
Chinese (zh)
Other versions
CN112256445A (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

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 a 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. Therefore, the data structure of the data to be displayed at the front end can be known, the problem of pollution can not occur when the data is transmitted at the front end and the rear end, and the difficulty of maintaining and upgrading the application program is effectively reduced.

Description

Data processing method, device, equipment and storage medium based on application program
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data processing method, device and equipment based on an application program and a storage medium.
Background
With the development of the mobile internet and the smart terminal, various application programs are widely developed and used. Applications are generally divided into front-end and back-end application layers. The front-end application layer may provide different types of front-end presentation pages to the user, 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 by a developer, programming is generally performed by adopting a JavaScript script language.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art: the JavaScript script language is a weak type language, so that the data structure of the data in the application program cannot be conveniently known after the application program runs on line for a period of time, and the pollution problem can occur when the data is transmitted at the front end and the rear end, which makes the subsequent maintenance and upgrading of the application program very difficult.
Disclosure of Invention
The embodiment of the invention provides a data processing method, a device, equipment and a storage medium based on an application program, which are used for solving the technical problems that the data structure of data in the application program cannot be conveniently known in the prior art, and the pollution problem can occur when the data is transmitted at the front end and the rear end, so that the subsequent maintenance and upgrading of the application program are 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, and 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 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 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 as described above, the data processing layer is carried in a node. Js running environment, and the data processing policy is represented by a front-end data transmission object;
The determining a data processing policy matched with the backend service data comprises:
Determining a back-end data transmission object matched with the back-end service data; acquiring a front-end data transmission object with 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 the node. Js operation environment, so that the data processing layer can effectively isolate the front end application layer from the back end application layer, the data processing strategy is expressed by adopting the front end data transmission object, and the front end data transmission object matched with the back end service data is determined according to the constructed mapping relation between the back end data transmission object and the front end data transmission object, so that the front end application layer and the back end application layer can be thoroughly decoupled without any mutual dependence, and the pollution problem of the data in front-back end transmission is further avoided.
Optionally, in the method as described above, the constructing a backend data transmission object corresponding to each service in the backend application layer 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 the 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 adopting the first key value, so that the data structure of the backend service data can be efficiently known when the application program is maintained and upgraded, and the difficulty of maintaining and upgrading the application program is further reduced.
Optionally, the method described above constructs a front-end data transmission object corresponding to each service in the back-end application layer, including:
acquiring display information of front-end to-be-displayed data 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 corresponding second attribute information of the front-end data to be displayed.
Optionally, in the method as described above, at least one of the back-end service data corresponding to each service and the front-end data to be displayed is corresponding to each service;
The construction of the mapping relationship between the back-end data transmission object and the front-end data transmission object corresponding to each service comprises the following steps: 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 data to be displayed 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 constructed, 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 constructed, so that the mapping relation between the back-end data transmission object and each data attribute information in the front-end data transmission object can be constructed more accurately, and the converted front-end data to be displayed is more accurate.
Optionally, the method for sending the front-end data to be displayed to the front-end application layer includes:
And sending 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 rendering processing to the front-end application layer.
In 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 processing layer determines the front-end data to be displayed, the front-end data to be displayed is rendered through the functional logic layer, so that the front-end application layer can better meet the display requirement when displaying the front-end data to be displayed, and the user experience of using the 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 the back-end service data sent by the back-end application layer, wherein the back-end service data corresponds to the 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 able to perform the method of any of the first aspects.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium having stored therein computer-executable instructions for performing the method according to any of the first aspects when executed by a processor.
The data processing method, the device, the equipment and the storage medium based on the application program provided by the embodiment of the invention are used for receiving the back-end service data sent by the back-end application layer, wherein 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 a 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. The attribute information of the front-end data to be displayed, which is predefined, comprises the attribute type of the front-end data to be displayed, so that the data structure of the front-end data to be displayed can be known, 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 by the data processing layer, the pollution problem can not occur when the front-end data is transmitted to the back-end data, and the difficulty of maintaining and upgrading an 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 disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic diagram of a first system architecture for a data processing method of an application program in which embodiments of the present invention may be implemented;
FIG. 2 is a flow chart of a method for application-based data processing according to an embodiment of the present invention;
FIG. 3 is a second system architecture diagram of a data processing method of an application program in which embodiments of the present invention may be implemented;
FIG. 4 is a flowchart of a data processing method 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 an application-based data processing method according to another embodiment of the present invention;
Fig. 6 is a schematic diagram of a relationship between back-end service data and front-end data transmission objects and front-end data to be displayed in a data processing method based on an application according to another embodiment of the present invention;
FIG. 7 is a schematic diagram of an application-based data processing apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a data processing apparatus based on an application program 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 invention;
fig. 10 is a second block diagram of an electronic device for implementing an application-based data method of an embodiment of the invention.
Specific embodiments of the present disclosure have been shown by way of the above drawings and will be described in more detail below. These drawings and the written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the disclosed concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
For a clear understanding of the technical solutions of the present application, first, the prior art solutions will be described in detail.
In the prior art, when an application program is developed, in order to improve the convenience of programming of a developer, a JavaScript script language is generally adopted for programming. The JavaScript script language is a weak type language, so that the data structure of the data in the application program cannot be conveniently known after the application program runs on line for a period of time, and the pollution problem can occur when the data is transmitted at the front end and the rear end, which makes the subsequent maintenance and upgrading of the application program very difficult.
The problem of pollution when the data is transmitted from front end to 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 synchronously modified. That is, each time the back-end service data is changed, the whole application program is synchronously modified, so that the back-end service data pollutes the whole application program.
In order to solve the problem that the data structure of the data in the application program cannot be known conveniently, the current solution is to use a strong type language TYPESCRIPT to replace JavaScript language or to use a structure of transmitting the data in front of and behind text notes. However, in the process of replacing JavaScript language by TYPESCRIPT language, the method is a comprehensive code transformation, the consumed labor cost is high, and the problem of untimely document updating exists by adopting a structure of transmitting data at the front end and the rear end of text remarks. And the two modes can not solve the pollution problem of data when the front end and the back end are transmitted.
Therefore, when the inventor can not conveniently know the data structure of the data in the application program in the prior art and the pollution problem occurs when the data is transmitted at the front end and the back end, the inventor finds that a data processing layer can be constructed between the front end application layer and the back end application layer in the research, the data processing layer can comprise a data processing strategy, the data processing strategy is responsible for predefining attribute information of the data to be displayed at the front end and a conversion strategy for converting the 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, and after the data processing layer receives the back end service data sent by the back end application layer, the back end service data can be processed according to the data processing strategy and converted into 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 sent to the front end application layer so as to display the data to be displayed at the front end. The attribute information of the front-end data to be displayed, which is predefined, comprises the attribute type of the front-end data to be displayed, so that the data structure of the front-end data to be displayed can be known, 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 by the data processing layer, the pollution problem can not occur when the front-end data is transmitted to the back-end data, and the difficulty of maintaining and upgrading an application program is effectively reduced.
The inventor proposes the technical scheme of the embodiment of the invention based on the creative discovery. The following describes a system architecture of an application-based data processing method according to an embodiment of the present invention. 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 backend 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 to the backend application layer may include: login services, product services, user services, order services, and other services. The data processing layer is located between the back-end application layer and the front-end application layer, and can be carried in a node. Js running environment to effectively isolate the back-end application layer from the front-end application layer. 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, the data processing layer stores various data processing strategies in advance, and determines the data processing strategies matched with the back-end service data so as to determine attribute information of front-end data to be displayed corresponding to the back-end service data, 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 front-end data to be displayed to the front-end application layer so as to display the front-end data to be displayed.
In the embodiment of the invention, the attribute information of the front-end to-be-displayed data defined in advance comprises the attribute type of the front-end to-be-displayed data, so that the data structure of the front-end to-be-displayed data can be known, and after the data processing layer is established, the change of the back-end service data can unify the front-end to-be-displayed data in the process of converting the back-end service data into the front-end to-be-displayed data by the data processing layer, so that the pollution problem of the front-end to-be-displayed data during front-end and back-end transmission can not occur, and the difficulty of maintaining and upgrading an application program is effectively reduced.
The terms involved in the embodiments of the present invention are explained below:
Js: based on the JavaScript running environment of the Chrome V8 engine, node. Js uses an event-driven, non-blocking I/O model. Node is a development platform for enabling JavaScript to run on a server, and enables JavaScript to be a script language which is level with the server languages such as PHP, python, perl, ruby. Network application with fast response speed and easy expansion can be conveniently built. The Node uses event driven, non-blocking I/O models to be lightweight and efficient, and is well suited for running data intensive real-time applications on distributed devices.
Data transfer object: english is: DATA TRANSFER Object, abbreviated as: DTO. Is a software application system for transferring data between design modes;
JSON: is a lightweight data interchange format that stores and presents data in a text format that is completely independent of the programming language. It makes JSON an ideal data exchange language due to its compact and clear hierarchical structure. 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 scheme of the present invention and how the technical scheme of the present invention solves the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Example 1
Fig. 2 is a flow chart of an application-based data processing method according to an embodiment of the present invention, and as shown in fig. 2, an execution subject of the application-based data processing method according to an embodiment of the present invention is an application-based data processing device, where the application-based data processing device may be located in a data processing layer, and the application may be installed in an electronic device, and the electronic device may be a computer, a notebook computer, a smart phone, or other devices with independent computing and processing capabilities, where the application-based data processing method according to the embodiment includes the following steps:
step 101, receiving back-end service data sent by a back-end application layer, where the back-end 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 display page for the user, where the type of the front-end display page is not limited. Such as a Web page, H5 page, APP page, host applet page, or other client, etc.
And displaying the 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 presentation page may present shopping service data, order service data, user service data, etc.
Specifically, after the user opens the application program, the front-end display page is displayed, and the user can trigger a certain service request by triggering a control in the front-end display page. Such as a request to query an order, a user login request, a merchandise search request, etc.
And after the data processing layer receives the service request, the validity of the service request can be checked, and after the service request passes the check, the service request is sent to the back-end application layer, so that the back-end application layer analyzes the service request to acquire service request identification information, and further the back-end service data is acquired from the corresponding service interface. The back-end 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 back-end application layer obtains back-end service data from the order service as order query result data, where the back-end service data may include: order serial number, trade name, order creation time, payment amount, payment mode, etc.
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 advance in a data processing layer, where the data processing policy corresponding to each service includes attribute information of data to be displayed at a front end and a conversion policy for converting the service data at a rear end into the data to be displayed at the front end.
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 data structure. For example, the method can be character type, integer type, single precision type, double precision type, array type, method type and the like.
It can be understood that the number of front-end data to be displayed corresponding to each service may be one or more, and if the number of front-end data to be displayed is plural, attribute information of each front-end data to be displayed and a 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 the form of key value pairs, key in the key value pairs stores attribute names, and value stores attribute types.
In this embodiment, the storage mode of the data processing policy may be a form of a data transmission object (DTO for short), or may be other modes, which is not limited in this embodiment.
Specifically, in this embodiment, after receiving the back-end service data, service identification information corresponding to the back-end service data may be obtained, and a data processing policy matched with the back-end service data may be determined according to the service identification information. Or may determine a data processing policy matching the backend service data in other manners, which is not limited in this embodiment.
And 103, processing the back-end service data according to a data processing strategy to obtain the data to be displayed at the front end.
In this embodiment, the back-end service data and the corresponding front-end data to be displayed are in the same service, but 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 front-end data to be displayed is obtained by the operation of the back-end service data.
Taking service as order inquiry service as an example, the back-end service data and the front-end data to be displayed and the mode of processing the back-end service data according to a data processing strategy are illustrated.
In order inquiry service, order inquiry result data provided by a back-end application layer is back-end service data, and the data included in the back-end service data are as follows: order serial number, trade name, order creation time. The attribute name of the order serial number is order number1, and the attribute type is integer type. The attribute name of the trade name is: goods, attribute type is object structure. The attribute name of the order creation time is: order set uptime, the attribute type is integer type. And the corresponding front-end data to be displayed only comprises: order serial 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 a tuple structure. The data processing policy of the order inquiry service includes attribute information of order serial numbers and trade names, a conversion policy that the order serial numbers in the back-end service data are converted into order serial numbers of the data to be displayed at the front end, and a conversion policy that the trade names in the back-end service data are converted into trade names of the data to be displayed at the front end. The conversion strategy 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 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 for converting the trade name in the back-end service data into 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 into the attribute type of the trade name of the front-end data to be displayed.
In this embodiment, the attribute information of the order serial number of the front-end to-be-displayed data is first obtained, then the attribute information of the order serial number in the back-end service data is converted into the attribute information of the order serial number in the front-end to-be-displayed data according to the conversion policy, then the attribute information of the trade name of the front-end to-be-displayed data 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 front-end to-be-displayed data according to the conversion policy. So as 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 JSON objects, or may be stored by using other modes, which is not limited in this embodiment.
And 104, transmitting 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 front-end data to be displayed is sent to the front-end application layer, and the front-end application layer displays the front-end data to be displayed according to the attribute name and the attribute type of the front-end data to be displayed.
According to the application program-based data processing method provided by the 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 a 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. The attribute information of the front-end data to be displayed, which is predefined, comprises the attribute type of the front-end data to be displayed, so that the data structure of the front-end data to be displayed can be known, 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 by the data processing layer, the pollution problem can not occur when the front-end data is transmitted to the back-end data, and the difficulty of maintaining and upgrading an application program is effectively reduced.
Example two
Fig. 3 is a schematic diagram of a second system architecture of a data processing method of an application program capable of implementing an 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.js operating environment, and further includes a functional logic layer, where the functional logic layer is located between the data processing layer and a front-end application layer, and is configured to render a front-end to-be-displayed and issue to the front-end application layer. The functional logic layer is also carried in the node. Js operation environment. And the whole system of the application program is programmed by JavaScript language.
Fig. 4 is a flowchart of an application-based data processing method according to another embodiment of the present invention, and as shown in fig. 4, the application-based data processing method according to this embodiment further refines steps 102 to 104 on the basis of the application-based data processing method according to the embodiment of fig. 2, and further includes a step of constructing a back-end data transmission object, a front-end data transmission object, and a step of constructing a mapping relationship between the back-end data transmission object and the front-end data transmission object corresponding to each service. The application-based data processing method provided in the present embodiment includes the following steps:
Step 201, constructing a back-end data transmission object corresponding to each service in the back-end application layer.
In this embodiment, for each service in the back-end application layer, a corresponding back-end data transmission object may be constructed. Attribute information of at least one back-end service data is stored in a back-end data transmission object of each service. Wherein the attribute information includes: attribute names and attribute types.
Optionally, in this embodiment, step 201 includes the steps of:
in step 2011, a first attribute name and a 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 back-end application layer, back-end service data may be acquired from the corresponding interface. Wherein, the back-end service data corresponding to each service can be one or more. And determining the attribute name and the attribute type of each back-end service data according to the acquired 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 character type, integer type, single precision type, double precision type, array type, etc.
In step 2012, the first attribute name and the first attribute type are formed into a first key pair.
Specifically, in this embodiment, for each back-end service data in each service, a key value pair is formed by the first attribute name and the corresponding first attribute type of each back-end service data, and the key value pair is a first key value pair.
Wherein the first attribute name is represented as a key in the first key pair and the first attribute type is represented as a value in the first key pair.
And 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, according to the acquisition sequence of the back-end service data in each service, the first key value pair corresponding to each back-end service data can be stored to form a corresponding back-end data transmission object.
It will be appreciated that the backend data transfer objects corresponding to each service in the backend application layer are stored in the data processing layer.
In this embodiment, when the 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 adopting the first key value, so that the data structure of the backend service data can be efficiently known when the application program is maintained and upgraded, and the difficulty of maintaining and upgrading the application program is further reduced.
Step 202, constructing front-end data transmission objects corresponding to each service in the back-end application layer.
In this embodiment, the data processing policy in the data processing layer is represented by a front-end data transmission object, so that the front-end data transmission object corresponding to each service in the back-end application layer is constructed. The front-end data to be displayed in the front-end data transmission object corresponding to each service can be one or more.
Optionally, in this embodiment, step 202 includes the steps of:
In step 2021, display information of front-end data to be displayed of each service in the back-end application layer is obtained.
In this embodiment, in the development process of the front-end application layer, a front-end developer designs and stores display information of front-end data to be displayed corresponding to each service. The display information comprises the quantity, the name, the data structure and the display effect of the data to be displayed at the front end. The display information of the front-end data to be displayed corresponding to each service can be obtained from the corresponding storage area.
Step 2022, constructing 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, step 2022 includes the steps of:
Step 2022a determines 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 forms the second attribute name and the second attribute type into a second key pair.
In step 2022c, the second key value pair is determined 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 the data to be displayed at each front end 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 the data to be displayed at each front end, 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 the second attribute information.
It is understood that the second attribute name of the front-end data to be exposed may be the same as or different from the first attribute name of the corresponding back-end service data. Similarly, the second attribute type of the front-end data to be displayed and the first attribute type of the corresponding back-end service data can be the same or different. If the attribute names and/or attribute types are different, the corresponding conversion strategies are needed to perform conversion.
Step 2023 obtains first attribute information of the back-end service data corresponding to the front-end data to be displayed.
In this embodiment, each front-end to-be-displayed data and each back-end service data may have identification information, so that the back-end service data corresponding to each front-end to-be-displayed data 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 constructs a 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, so as to determine the distinction and conversion relationship between the first attribute information and the second attribute information, and according to the distinction and conversion relationship, a conversion strategy in the corresponding front-end data transmission object is constructed.
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 corresponding second attribute information of the front-end data to be displayed.
Step 2025, determining whether the corresponding front-end data transmission object includes a dependency item according to the presentation information.
In this embodiment, the dependent item in the front-end data transmission object is a dependent data transmission object, which may be simply referred to as a dependent DTO.
In this embodiment, if the data to be displayed at the front end in the display information of the data to be displayed at the front end in a certain service is a dependency relationship, it is indicated 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 acquisition service, the display information of the data to be displayed at the front end includes a provincial address, a municipal address and a district address, but the provincial address, the municipal address and the district address are in a hierarchical relationship, if attribute information of the provincial address and a corresponding conversion policy are stored in a front end data transmission object corresponding to the address acquisition service, the dependent DTO includes a DTO corresponding to the municipal address and a DTO corresponding to the district address. Specifically, the dependency relationship can be represented as shown in fig. 5. In fig. 5, the representation information of the front-end data transmission object, i.e., id information, may also be included.
If it is determined that the dependent item is included, then the dependent item is added to the corresponding front-end data transfer object, step 2026.
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, a mapping relationship between the back-end data transmission object and the front-end data transmission object corresponding to each service is constructed.
Optionally, in this embodiment, step 203 includes the following steps:
Step 2031, for each service, acquiring a first key value pair corresponding to each piece of back-end service data in the back-end data transmission object, and acquiring a second key value pair corresponding to each piece of front-end data to be displayed in the corresponding front-end data transmission object.
Wherein, the back-end service data corresponding to each service and the corresponding front-end data to be displayed are at least one. It will be appreciated that the amount of back-end service data corresponding to each service may be different from the amount of front-end data to be presented.
Specifically, in this embodiment, a first key value pair corresponding to each piece of back-end service data in a back-end data transmission object is obtained, and a second key value pair corresponding to each piece of front-end data to be displayed in a 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 the data to be displayed at each front end in the front-end data transmission object can be determined.
In step 2032, a mapping relationship between the first key-value pair and the corresponding second key-value pair is constructed.
In this embodiment, if the identification information of the back-end service data and the front-end data to be displayed are the same, and represent the same meaning, then the mapping relationship between the first key value pair and the corresponding second key value pair, where the identification information is the same, is directly constructed. If the front-end to-be-displayed data related to the front-end service data is determined to be not available according to the identification information of the back-end service data, the mapping relation between the first key value pair of the back-end service data and the second key value pair of the front-end to-be-displayed data is not required to be constructed. If the front-end to-be-displayed data related to the front-end to-be-displayed data is determined according to the identification information of the back-end service data, but the front-end to-be-displayed data needs at least one back-end service data to be converted and obtained, a mapping relation between a first key value pair of the at least one back-end service data and the front-end to-be-displayed data is constructed.
It can be understood that, if the front-end data to be displayed needs at least one back-end service data to be converted, the attribute type of the front-end display data stored in the front-end data transmission object corresponding to the front-end display 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 constructed, 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 constructed, so that the mapping relation between the back-end data transmission object and each data attribute information in the front-end data transmission object can be constructed more accurately, and the converted front-end data to be displayed is more accurate.
Step 204, receiving back-end service data sent by the back-end application layer, where the back-end service data corresponds to a service request sent by the front-end application layer.
In this embodiment, as shown in fig. 6, the received back-end service data sent by the back-end application layer may be the representation in the leftmost table in fig. 6, where the back-end service data includes four data. Respectively designated key1 through key4.
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 adopts a front-end data transmission object representation. Then the front-end data transfer object includes: and converting the back-end service data into a conversion strategy of the front-end data to be displayed. A dependent DTO may also be included in the front-end data transfer object.
Optionally, step 205 includes the steps of:
step 2051, a backend data transfer object is determined that matches the backend service data.
Specifically, each service may have corresponding service identification information, and after the back-end data transmission object is constructed, the service identification information and the back-end data transmission object may be stored in association. It may be determined whether the back-end service data has a matching back-end data transfer object based on the service identification information.
Step 2052, obtaining a front-end data transmission object having a mapping relationship with the back-end data transmission object.
Step 2053, determining the front-end data transmission object with the mapping relationship as a data processing policy matched with the back-end service data.
Specifically, in this embodiment, a mapping relationship between a back-end data transmission object and a front-end data transmission object may be obtained, a front-end data transmission object having a mapping relationship with a matched back-end data transmission object may be obtained, and the front-end data transmission object having the mapping relationship may be determined as a data processing policy matched with back-end service data.
And 206, processing the back-end service data according to the data processing strategy to obtain the data to be displayed at the front end.
Optionally, in this embodiment, step 206 includes the steps of:
step 2061, obtaining attribute information of front-end to-be-displayed data 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 attribute information of data to be displayed in three front-ends is included in the front-end data transmission object by way of example. Attribute information of key1 to key3, respectively. Wherein the attribute type of key1 is character type. The attribute type of Key is numerical, and the attribute type of Key3 is a method body. Wherein, the back-end service data corresponding to the front-end data key1 to be displayed is key1. The back-end service data corresponding to the front-end data key2 to be displayed is key2. The back-end service data corresponding to the front-end data key3 to be displayed are key3 and key4. The method body is to return the value after the back-end service data key3 and key4 are combined.
Step 2062, if the attribute type in the attribute information is the preset data type, reading the 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 the output value under the attribute name corresponding to the data to be displayed at the front end.
Wherein, the preset data types are other types of the dividing method body, and the preset data types 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 a method body type, reading the 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 the output value under the attribute name corresponding to the data to be displayed at the front end.
Specifically, in this embodiment, the attribute information of the data to be displayed at the first front end of the front end data transmission object is read, whether the value in the second key pair of the attribute information is a preset attribute type is determined, if the value is the preset attribute type, the return value under the corresponding attribute name key in the back end service data is read, and the return value is converted into the attribute type defined by the value according to the conversion policy, so as to obtain the output value under the corresponding attribute name of the data to be displayed at the first front end. If the method is the method body type, 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, and executing the method in the method body to obtain a corresponding return value, wherein the return value is an output value under the attribute name corresponding to the data to be displayed at the front end.
After the output value of the first front-end to-be-displayed data under the corresponding attribute name is obtained, the value of the key in the temporary object can be assigned for storage.
And judging whether the front-end data transmission object comprises the 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 of the next front-end data to be displayed under the corresponding attribute name according to the attribute type in the corresponding value, and storing the output value in the 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. And if the attribute type of the front-end data key1 to be displayed is character type (string), reading the return value under the back-end service data key1 as a test case, and converting the return value into character type according to a conversion strategy to obtain the output value under the attribute name corresponding to the front-end data key1 to be displayed as the test case. And if the attribute type of the front-end data key2 to be displayed is numerical value (number), reading the return value of the back-end service data key1 to be '999', and converting the return value into numerical value according to a conversion strategy to obtain the output value of the front-end data key1 to be displayed under the corresponding attribute name to be '999'. And if the attribute type of the front-end data key3 to be displayed is a method body, reading that return values under the back-end service data key3 and the key4 are 'Hello' and 'World', and converting the return values into method body types according to a conversion strategy to obtain an output value under the attribute name corresponding to the front-end data key3 to be displayed as '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 displayed 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 corresponding to the data to be displayed at the front end and the output value are stored in the JSON object, and the data stored in the JSON object is the data to be displayed at the front end.
Step 207, the front-end data to be displayed is sent to the functional logic layer, so that the functional logic layer performs rendering processing on the front-end data to be displayed and sends the rendering processing 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 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 front-end data to the front-end application layer after rendering processing, so that the front-end application layer displays the front-end data to be displayed according to a rendering processing result after receiving the rendering processed front-end data to be displayed.
It will be appreciated that the functional logic layer may not be traversed when the front-end application layer sends a service request to the data processing layer.
In this embodiment, a functional logic layer is built between the data processing layer and the front-end application layer, after the data processing layer determines that the front-end data to be displayed is to be rendered through the functional logic layer, so that when the front-end application layer displays the front-end data to be displayed, the display requirement is met more, and the user experience of 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, as shown in fig. 7, where the application-based data processing apparatus according to the 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, and the application-based data processing apparatus 70 according to the embodiment includes: a data receiving module 71, a processing policy determining module 72, a data processing module 73 and a data transmitting module 74.
The data receiving module 71 is configured to receive back-end service data sent by the back-end application layer, where the back-end service data corresponds to a service request sent by the front-end application layer. The processing policy determining module 72 is configured to determine a data processing policy that matches 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. The data processing module 73 is configured to process the back-end service data according to a data processing policy, so as to obtain front-end data to be displayed. 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 application-based data processing provided in this embodiment may execute the technical scheme of the method embodiment shown in fig. 2, and its implementation principle and technical effects are similar to those of the method embodiment shown in fig. 2, and are not described in detail herein.
Example IV
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 according to fig. 7: a module 81 is constructed.
Optionally, the data processing layer is installed in a node. Js running environment, and the data processing policy is represented by a front-end data transmission object. Accordingly, the processing policy determination module 72 is specifically configured to:
Determining a back-end data transmission object matched with the back-end service data; acquiring a front-end data transmission object with 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, the construction module 81 is 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 construction module 81 is specifically configured to, when constructing 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 construction module is specifically configured to, when constructing a front-end data transmission object corresponding to each service in the back-end application layer:
Acquiring display information of front-end to-be-displayed data of each service in a 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.
Optionally, the construction 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 the dependency term is determined to be included, the dependency term is added to the corresponding front-end data transfer object.
Optionally, the construction module 81 is specifically configured to, 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:
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 set, and accordingly, the construction module 81 is specifically configured to, when constructing the mapping relationship between the back-end data transmission object corresponding to each service and the front-end data transmission object: 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 data to be displayed 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 rear-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 corresponding attribute name of the corresponding back-end service data, and converting the return value into the preset attribute type according to a conversion strategy to obtain an output value under the corresponding attribute name of the data to be displayed at the front end; if the attribute type in the attribute information is a method body type, reading a return value under the corresponding attribute name of the corresponding back-end service data, and inputting the return value into the method body to obtain an output value under the corresponding attribute name of the data to be displayed at the front end; 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 front-end data to be displayed to the functional logic layer, so that the functional logic layer performs rendering processing on the front-end data to be displayed and sends the rendering processing to the front-end application layer.
The application-based data processing device provided in this embodiment may execute the technical scheme of the method embodiment shown in fig. 4, and its implementation principle and technical effects 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 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, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like, for implementing an application-based data method of an embodiment of the present invention.
The electronic device 1000 may include one or more of the following components, among others: a processing component 1002, a memory 1004, a power component 1006, a multimedia component 1008, an audio component 1010, an input/output (I/O) interface 1012, a sensor component 1014, and a 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 component 1002 can include one or more processors 1020 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 1002 can include one or more modules that facilitate interaction between the processing component 1002 and other components. For example, the processing component 1002 can include a multimedia module to facilitate interaction between the multimedia component 10010 and the 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 nonvolatile 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 disk.
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 supplies, and other components associated with generating, managing, and distributing power for the electronic device 1000.
The multimedia component 1008 includes a screen between the electronic device 1000 and the user that provides an output interface. 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 input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or sliding action, but also the duration and pressure associated with the touch or sliding operation. In some embodiments, the multimedia assembly 1008 includes a front-facing camera and/or a rear-facing camera. When the electronic device 1000 is in an operational mode, such as a shooting mode or a video mode, the front-facing camera and/or the rear-facing camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 1010 is configured to output and/or input audio signals. For example, the audio component 1010 includes 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 signals may be further stored in memory 1004 or transmitted via communication component 1016. In some embodiments, the audio component 1010 further comprises a speaker for outputting audio signals.
The I/O interface 1012 provides an interface between the processing assembly 1002 and peripheral interface modules, which may be a keyboard, click wheel, buttons, and the like. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 1014 includes one or more sensors for providing status assessment of various aspects of the electronic device 1000. For example, the sensor assembly 1014 may detect an on/off state of the electronic device 1000, a relative positioning of the components, such as a display and keypad of the electronic device 1000, the sensor assembly 1014 may also detect a change in position of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of a user's 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 nearby objects in the absence of 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 can also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1016 is configured to facilitate communication between the electronic device 1000 and other devices, either wired or wireless. 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 one exemplary embodiment, the communication component 1016 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication 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, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 1004, including instructions executable by processor 1020 of electronic device 1000 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
A non-transitory computer readable storage medium, which when executed by a processor of an electronic device, causes a terminal device to perform the 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 adaptations, 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 is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (18)

1. An application-based data processing method, wherein the method is 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 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;
Transmitting the front-end data to be displayed to a front-end application layer so as to display the front-end data to be displayed;
The data processing strategy is represented by a front-end data transmission object;
the processing the back-end service data according to the data processing policy to obtain front-end data to be displayed includes:
Acquiring attribute information of front-end data to be displayed corresponding to the rear-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 to obtain an output value under the attribute name corresponding to the data to be displayed at the front end;
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 the method body to obtain an output value under the attribute name corresponding to the data to be displayed at the front end;
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.
2. The method of claim 1, wherein the data processing layer is hosted in a node. Js runtime environment;
The determining a data processing policy matched with the backend service data comprises:
Determining a back-end data transmission object matched with the back-end service data;
acquiring a front-end data transmission object with 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 said constructing a backend data transfer 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. A method according to claim 3, wherein said constructing a front-end data transfer object corresponding to each service in the back-end application layer comprises:
Acquiring display information of front-end to-be-displayed data 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 as recited in 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 the dependency item is determined to be included, the dependency item is added to the corresponding front-end data transmission object.
7. The method according to claim 5, wherein the 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 includes:
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. A method according to claim 3, wherein the number of the corresponding back-end service data and the corresponding front-end data to be displayed for each service is at least one;
The construction of the mapping relationship between the back-end data transmission object and the front-end data transmission object corresponding to each service comprises the following steps:
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 data to be displayed 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 any one of claims 1-8, wherein the sending the front-end data to be exposed to a front-end application layer includes:
And sending 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 rendering processing to the front-end application layer.
10. 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 the back-end service data sent by the back-end application layer, wherein the back-end service data corresponds to the 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;
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;
The data processing strategy is represented by a front-end data transmission object;
The data processing module is specifically configured to:
Acquiring attribute information of front-end data to be displayed corresponding to the rear-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 to obtain an output value under the attribute name corresponding to the data to be displayed at the front end; 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 the method body to obtain an output value under the attribute name corresponding to the data to be displayed at the front end; 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.
11. The apparatus of claim 10, wherein the data processing layer is hosted in a node. Js runtime environment;
The processing policy determining module is specifically configured to:
Determining a back-end data transmission object matched with the back-end service data; acquiring a front-end data transmission object with 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.
12. The apparatus as recited in claim 11, further comprising: a construction module for:
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.
13. The apparatus of claim 12, wherein the construction module, when constructing a backend data transfer 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.
14. The apparatus of claim 12, wherein the construction module, when constructing the 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 to-be-displayed data 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.
15. The apparatus of claim 14, wherein the build module is further to:
judging whether the corresponding front-end data transmission object comprises a dependent item or not according to the display information; if the dependency item is determined to be included, the dependency item is added to the corresponding front-end data transmission object.
16. The device according to any one of claims 10 to 15, wherein,
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 rendering processing to the front-end application layer.
17. 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 able to perform the method of any of claims 1-9.
18. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any one of claims 1-9.
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 CN112256445A (en) 2021-01-22
CN112256445B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114840286B (en) * 2021-06-16 2023-07-14 工信(北京)产业发展研究院有限公司 Service processing method and server based on big data

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IN2012CH04482A (en) * 2012-10-26 2015-06-19 Exceed Technology Solutions Private Ltd I
CN106202096A (en) * 2015-05-05 2016-12-07 阿里巴巴集团控股有限公司 Customer terminal webpage rendering intent and device
CN110704481B (en) * 2018-06-25 2024-04-05 北京京东尚科信息技术有限公司 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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN112256445A (en) 2021-01-22

Similar Documents

Publication Publication Date Title
CN116126350B (en) Binary translation method, binary translator and electronic equipment
US20230328028A1 (en) Method and apparatus for providing information
CN113254784A (en) Information display method and device, electronic equipment and storage medium
CN112256445B (en) Data processing method, device, equipment and storage medium based on application program
CN113986574A (en) Comment content generation method and device, electronic equipment and storage medium
CN107220371B (en) Page display method and device and storage medium
CN107179837B (en) Input method and device
CN111046265B (en) Card data display method, device, equipment and storage medium
CN116362206A (en) File processing method, device, equipment and medium
CN112486617B (en) Ciphertext data processing architecture, method, apparatus and machine readable medium
CN112667852B (en) Video-based searching method and device, electronic equipment and storage medium
US11284127B2 (en) Method and apparatus for pushing information in live broadcast room
CN112862349B (en) Data processing method, device and equipment based on ABS service data
CN113128181B (en) Information processing method and device
CN112052395B (en) Data processing method and device
CN111984864B (en) Object recommendation method, device, electronic equipment and storage medium
CN114896165A (en) Testing method and device of conversation robot system, electronic equipment and storage medium
CN110457084B (en) Loading method and device
CN112732734A (en) Information processing method and device
US20190018502A1 (en) Method and device for obtaining operation entry, and storage medium
CN110989987A (en) Portal webpage generation method, portal webpage generation device, client, server and storage medium
CN111061633A (en) Method, device, terminal and medium for detecting first screen time of webpage
CN112003788B (en) Data request sending method, device, equipment and medium
CN113778385B (en) Component registration method, device, terminal and storage medium
CN110119471B (en) Method and device for checking consistency of search results

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