Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, the present invention provides an information processing method, including:
step 100, obtaining information to be processed;
step 101, determining the data type of the information, and converting the data in the information into a layout device corresponding to the data type of the information;
and 102, converting the data in the layout device into a view, and displaying the view on the same interface.
Therefore, according to the technical scheme, the corresponding layout device can be selected according to the data type of the information, so that the information of different data types can be displayed in an optimal form through the layout device, and the information can be displayed on the same interface of the terminal by adopting the corresponding layout device aiming at the complex information of a plurality of data types contained in one piece of information, so that the time for switching the interface by a user is reduced, and the user experience is improved.
Embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
As shown in fig. 2, the present invention provides an information processing method, including:
step 200, obtaining information to be processed;
step 201, classifying the acquired information according to information types; wherein the source of the information is taken as the information type; and storing according to the information type of the information;
step 202, determining the data type of the information, and converting the data in the information into a layout device corresponding to the data type of the information;
and step 203, converting the data in the layout device into a view, and displaying the view on the same interface.
In the solution of the embodiment of the present invention, the information processing method may be divided into three layers, where steps 200 and 201 are processes for performing data processing on the acquired information, and therefore the layers corresponding to steps 200 and 201 are data processing layers; step 202 is a processing procedure of converting the information data into a layout device, so that the layer corresponding to step 202 is an adaptation processing layer; step 203 is a processing procedure for converting the data in the layout device into a view, so that the layer corresponding to step 102 is a view processing layer; as shown in fig. 3, the overall process of the solution of the present invention is described in a static hierarchical structure.
Specifically, the information to be processed is obtained in step 200, and the information may be classified into short messages, instant messaging information, microblog information and the like according to the source of the information, or information from other systems.
Specifically, the step 201 may include two processes:
(1) classifying the acquired information according to information types; in the embodiment of the present invention, the source of the information may be used as the information type;
in the embodiment of the present invention, in order to clearly and completely describe each piece of acquired information, the description may refer to a field form in the following table, or may modify itself according to its own requirements:
| id | unique identification of information |
| sender | Information data sender |
| Type | Data type |
| Content list | Data content queue |
| time | Time of information reception |
(2) Storing according to the information type of the information;
in the embodiment of the invention, according to the information type of the information, an information type queue for storing the information is determined by traversing the existing information data;
when an information type queue for storing the information is found in the existing information type queue, the information is inserted into the head of the queue; when the information type queue for storing the information is not found in the existing information type pair, an information type queue can be newly created according to the information type of the information, and the information is inserted into the queue.
In addition, when the information data is added by traversing the existing information data, the traversing of the existing information data can be realized by the following technical scheme:
traversing all data in the existing information type queue through the queue pointer type _ index and the offset pointer offset _ index specifically includes:
the queue pointer type _ index starts from the first information type queue, and forwards the offset pointer offset _ index to the tail of the first information type queue each time;
after traversing the first information type queue, moving the queue pointer type _ index to the next information type queue, and moving the offset pointer offset _ index forward to traverse each data in the information type queue until the last information type queue is traversed.
In the embodiment of the invention, the mode of traversing the existing information data can adopt a complete traversal mode, namely traversing the data in all the existing information type queues; a partial traversal may also be used, i.e. traversing one or some of the existing information type queues.
Specifically, step 202 may include:
(1) determining data types contained in the information, wherein the data types comprise a single type and a plurality of types;
the single type is any one of text information, picture information, video or music information; the multiple types are at least two types of text information, picture information, video or music information contained in the information;
(2) selecting a corresponding layout device according to the determined data type of the information, wherein the layout device comprises a single-type layout device and a multi-type layout device; filling data in the information into the selected placer.
It should be noted that the layout device according to the embodiment of the present invention functions as a component for converting data in acquired information into a view, where "converting" refers to filling data in a piece of information into a layout device, and then the data in the layout device can generate a view of the data.
In the embodiment of the present invention, different placers are provided for data types of information, where a single-type placer may be implemented by using a technical solution of a single-type placer in the prior art, for example: when the data type of the information is only text information, filling the data by using a text placer as shown in FIG. 4 in the single-type placer; when the data type of the information is picture information, a picture placer as shown in fig. 5 among the single-type placers may be used to fill the data; when the data type of the information is video or music information, filling the data using a placer as shown in fig. 6 among the single type placers;
further, when at least two data types are included in the information, a multi-type placer, as shown in FIG. 7, may be employed to fill in the data in the information.
Specifically, the populating the data in the information into the selected placer includes:
when the data type of the information is a multi-type, filling the data in the information into a selected multi-type layout device, where the multi-type layout device is a paged layout device, and the method specifically includes:
sequentially filling data corresponding to each data type in the information into each page view provided by a paging type layout device, wherein each page view is only limited to filling data of one data type contained in the information; that is, text information, picture information, video and music information contained in the same information are respectively filled into each page in the page type layout device;
the page type layout device provides two page turning buttons for page turning operation of the view so as to view the data of the filled previous page or the next page.
Specifically, step 203 may include:
and determining the position required for displaying the data in the view according to the data in the layout device, and converting the data in the layout device into the view according to the determined position.
Further specifically, step 203 may be implemented by the following technical solution:
(1) calculating the height and width required by the filled data in the layout device when the filled data are displayed so as to determine the area of the layout device placed in the view;
(2) finding coordinates (x, y) of the upper left corner of the placer area in the view relative to the upper left corner of the entire view;
(3) taking out a rectangle with (x, y) as an upper left corner coordinate and width and height as height and width required by the display of the data filled in the layout device from the canvas of the whole view, and taking the rectangle as the canvas of the layout device;
(4) and drawing the data filled in the layout device on a canvas of the layout device in sequence to finish the conversion process from the layout device to the view.
In addition, in order to more clearly illustrate the specific process implemented in step 203, the following detailed description is provided with reference to the accompanying drawings:
firstly, calculating the height (height) and width (width) of data in a layout device filled with data in view display, and determining the area in the view where the current layout device can be placed;
as shown in FIG. 8, if the width of the current placer is < width _1, then the current placer is placed in area A; if width _2 > width and width > width _1, then place the current placer in the B area; if the width is larger than the width _2, the current placer is placed in the C area;
secondly, finding the coordinates (x, y) of the upper left corner of the placement area relative to the upper left corner of the whole view;
then, cutting off a rectangle which takes (x, y) as the coordinate of the upper left corner, has a width and a height and is used as the canvas of the current layout device in the canvas of the whole view;
and finally, drawing the data filled in the current layout device on the canvas in sequence to finish the conversion from the layout device to the view.
It should be noted that, when all data in the acquired information are converted into corresponding layout devices and all the layout devices are converted into views, the whole view processing process is finished, and at this time, information of various data types may be displayed on a screen of the terminal adopting the information processing method.
In addition, the embodiment of the present invention may also provide a user with a function of a custom layout device, where several information types may be configured in advance in the custom layout device, and the information types are provided to the user in a list manner, for example: the user may select a message in several types of information in fig. 9, with the layout of the selected message being customized by the custom layout. In addition, in the embodiment of the invention, the list is established by taking the information source as the information type, and in the implementation process of the invention, the information type can be defined according to the actual requirement, and the specific content of the information type is not limited in the invention;
in the custom layout device, diversified custom styles can be provided, as shown in fig. 9, after a user selects an information type, the user can select the information type from a plurality of custom styles on the right side according to the preference of the user, wherein the custom styles can include a page turning style, a grid style, a list style, a custom style and the like;
after the user selects the custom style, the custom layout device may provide a layout device editing page, and the user may customize the display mode of the information, specifically, may adopt a grid drawing mode, as shown in fig. 10. In this way the user can define the size and position of the display area of each data block in the information to determine the placement and size of the data,
after a user sets the personalized layout device through the customized layout device, the customized layout device is integrated into the adaptation processing layer, and when information corresponding to the information type of the personalized layout device is received, data in the information is directly filled into the personalized layout device so as to perform a view conversion step.
By providing the user-defined layout device for the user, the user can set the personalized layout device, and the personalized requirements of the user can be met in the process of converting data in the layout device into the view, so that the user can browse the information display interface which accords with the requirements of the user.
The information processing method of the embodiment of the invention can be applied to terminal equipment, and the terminal equipment can be a mobile phone, a tablet personal computer and the like.
As shown in fig. 11, based on the information processing method proposed by the above embodiment, the present invention also proposes an information processing system, which includes:
a data processor 91 for acquiring information to be processed;
an adaptation processor 92, configured to determine a data type of the information stored by the data processor, and convert data in the information into a placer corresponding to the data type of the information;
and the view processor 93 is used for converting the data in the layout device into a view and displaying the view on the same interface.
Therefore, according to the technical scheme, the corresponding layout device can be selected according to the data type of the information, so that the information of different data types can be displayed in an optimal form through the layout device, and the information can be displayed on the same interface of the terminal by adopting the corresponding layout device aiming at the complex information of a plurality of data types contained in one piece of information, so that the time for switching the interface by a user is reduced.
Specifically, the data processor 91 is further configured to:
classifying the acquired information according to information types; wherein the source of the information is taken as the information type; and storing according to the information type of the information.
Specifically, as shown in fig. 12, the data processor 91 further includes:
a data obtaining module 911, configured to obtain information to be processed;
a data classification module 912, configured to classify the acquired information according to information types;
a data control module 913, configured to determine, according to the information type of the information determined by the data classification module, an information type queue for storing the information in a manner of traversing existing information data;
when an information type queue for storing the information is found in the existing information type queue, the information is inserted into the head of the queue; otherwise, an information type queue is created according to the information type of the information, and the information is inserted into the queue.
Furthermore, after the data classification module acquires the information to be processed, the data acquisition module classifies the received information according to the information type, in the embodiment of the invention, the source of the information is preferably used as the information type, wherein the source of the information can comprise information from different communication systems, such as short messages, instant messaging information, microblog information and the like;
in addition, for clearly describing each piece of acquired information, each piece of information may be represented by several fields, for example, several fields may include: id (unique identification of information), sender (sender of information data), Type (data Type), Content list, and ime (time of information reception). The invention can be self-improved according to the requirements in the specific implementation.
Specifically, the method for traversing the existing information data includes:
traversing all data in the existing information type queue through the queue pointer and the offset pointer;
the queue pointer starts from a first information type queue, and the offset pointer is moved forward to the tail of the first information type queue each time;
and after traversing the first information type queue, moving the queue pointer to the next information type queue, and moving the offset pointer forward to traverse each data in the information type queue until the last information type queue is traversed.
In the embodiment of the invention, the mode of traversing the existing information data can adopt a complete traversal mode, namely traversing the data in all the existing information type queues; a partial traversal may also be used, i.e. traversing one or some of the existing information type queues.
Specifically, as shown in fig. 12, the adaptation processor 92 includes:
a type determining module 921, configured to determine data types included in the information, where the data types include a single type and multiple types;
the single type is any one of text information, picture information, video or music information; the multiple types are at least two types of text information, picture information, video or music information contained in the information;
the data conversion module 922 is configured to select a corresponding layout device according to the data type of the information determined by the type determination module, where the layout device includes a single-type layout device and a multi-type layout device; and populating data in the information into the selected placer.
Specifically, as shown in fig. 12, the data conversion module 922 specifically includes:
a placer selecting unit 9221, configured to select a corresponding placer according to the data type of the information determined by the type determining module;
a data filling unit 9222, configured to, when the placer selected by the placer selecting unit is a multi-type placer, sequentially fill data corresponding to each data type in the information into each page view provided by the multi-type placer, where each page view is limited to fill data of one data type included in the information; the multi-type layout device is a paging layout device:
the page type layout device provides two page turning buttons for page turning operation of the view so as to view the data of the filled previous page or the next page.
Further, in the embodiment of the present invention, different placers are provided for data types of information, where a single-type placer may be implemented by using a technical solution of a single-type placer in the prior art, for example: when the data type of the information is only text information, filling the data by using a text placer as shown in FIG. 4 in the single-type placer; when the data type of the information is picture information, a picture placer as shown in fig. 5 among the single-type placers may be used to fill the data; when the data type of the information is video or music information, filling the data using a placer as shown in fig. 6 among the single type placers;
further, when at least two data types are included in the information, a multi-type placer, as shown in FIG. 7, may be employed to fill in the data in the information.
Specifically, the view processor 93 is specifically configured to:
and determining the position required for displaying the data in the view according to the data converted into the layout by the adaptation processor, and converting the data in the layout into the view according to the determined position.
More specifically, as shown in fig. 12, the view processor 93 includes:
a region determining module 931, configured to calculate the height and width of the data filled in the layout device when the data is displayed, so as to determine the region where the layout device is placed in the view; and is further used for finding the coordinates (x, y) of the upper left corner of the layout device placement area in the view relative to the upper left corner of the whole view;
a canvas generation module 932, configured to take a rectangle with (x, y) as an upper left corner coordinate and width and height as height and width required for displaying data filled in the layout device, from the canvas of the entire view, as the canvas of the layout device;
and the view conversion module 933 is configured to sequentially draw the data filled in the layout device on the canvas of the layout device, so as to complete the conversion process from the layout device to the view.
It should be noted that, when all data in the acquired information are converted into corresponding layout devices and all the layout devices are converted into views, the whole view processing process is finished, and at this time, information of various data types may be displayed on a screen of the terminal adopting the information processing method.
The information processing method of the embodiment of the invention can be applied to terminal equipment, and the terminal equipment can be a mobile phone, a tablet personal computer and the like.
It should be noted that the embodiment of the present invention is a system embodiment obtained based on the method embodiment shown in fig. 1, and includes the same or corresponding technical solutions as those in the embodiment of fig. 1, and therefore, the technical solutions related to the embodiment of the method shown in fig. 1 and the same as those in the embodiment of the method shown in fig. 1 in the embodiment of the present invention may refer to the description of the embodiment of fig. 1, which is not repeated herein.
It can be seen from the foregoing technical solutions that, in the information processing method and system provided in the embodiments of the present invention, for received information, a corresponding layout device can be selected according to a data type of the information, so that the received information can be displayed on the same interface of a terminal.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.