Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a data processing method and a corresponding data processing apparatus that overcome or at least partially solve the above problems.
The embodiment of the invention discloses a data processing method, which is applied to a server, wherein the server is used for issuing current display information of multimedia, and the data display position of the current display information has at least two display types, and the method comprises the following steps:
acquiring first script data;
analyzing the first script data to generate an acquisition array;
splitting the first original data of the acquisition array to obtain correction data;
and correcting the current display information according to the correction data.
Optionally, the first script data includes a plurality of identification bits, and the step of analyzing the first script data to generate the collection array includes:
analyzing a field corresponding to the identification bit in the first script data to generate content data;
and generating a collection array by taking the content data as elements.
Optionally, the step of analyzing the field corresponding to the identification bit in the first script data to generate content data includes:
acquiring a segmentation character string;
and analyzing the field by adopting the segmentation character string to generate content data.
Optionally, the server stores history display information, and before the step of analyzing the first script data and generating an acquisition array, the method further includes:
reading second script data corresponding to the historical display information;
judging whether the first script data and the second script data meet a first preset condition or not;
and if so, adopting the historical display information as the current display information.
Optionally, the splitting the first original data of the acquisition array to obtain the correction data includes:
splitting the first original data of the acquisition array to obtain target data;
judging whether the target data is empty or not;
and when the target data is not empty, determining the target data as correction data.
Optionally, the step of correcting the current display information according to the correction data includes:
and replacing the second original data of the data display position with the correction data, and correcting the current display information.
Optionally, the server is connected to the vehicle-mounted terminal through a bluetooth wireless network, and the method further includes:
and sending the corrected current display information to the vehicle-mounted terminal through the Bluetooth wireless network, wherein the vehicle-mounted terminal is used for displaying the corrected current display information.
The embodiment of the invention also discloses a data processing device, which is applied to a server, wherein the server is used for issuing the current display information of multimedia, the data display position of the current display information has at least two display types, and the device comprises:
the acquisition module is used for acquiring first script data;
the analysis module is used for analyzing the first script data to generate an acquisition array;
the splitting module is used for splitting the first original data of the acquisition array to obtain correction data;
and the correction module is used for correcting the current display information according to the correction data.
The embodiment of the invention also discloses a vehicle comprising:
one or more processors; and
one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the vehicle to perform one or more methods as described above.
Embodiments of the invention also disclose one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform one or more of the methods described above.
The embodiment of the invention has the following advantages:
the method comprises the steps of acquiring first script data, analyzing the first script data to generate an acquisition array, splitting first original data of the acquisition array to obtain correction data, and correcting the current display information according to the correction data; and correcting the multimedia display information so that the vehicle-mounted terminal can acquire correct multimedia display information.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention more comprehensible, the present invention is described in detail with reference to the accompanying drawings and the detailed description thereof.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a data processing method according to the present invention is shown, and is applied to a server, where the server is configured to issue current display information of multimedia, and a data display position of the current display information has at least two display types.
It should be noted that the multimedia includes audio-playing multimedia such as audio recording, radio broadcasting, music, and the like. The current display information may include a genre of the multimedia, an author of the multimedia, a multimedia name, a multimedia serial number, and the like. Multimedia album names, etc. Hereinafter, embodiments of the present invention will be described by taking songs as examples.
The current display information is transferred through the following arrays:
[ID_TITLE,ID_ARTIST,ID_ALBUM,ID_NUMBER_OF_MEDIA, ID_TOTAL_NUMBER_OF_MEDIA,ID_GENRE,ID_SONG_LENGTH]
wherein, the definition of the array is:
ID _ TITLE is TITLE of the media (song TITLE);
ID _ ARTIST is name of the ARTIST name;
ID _ ALBUM is name of the ALBUM;
ID _ NUMBER _ OF _ MEDIA is NUMBER OF the MEDIA (song NUMBER);
ID _ TOTAL _ NUMBER _ OF _ MEDIA is the TOTAL NUMBER OF the MEDIA;
ID _ GENRE is GENRE;
ID _ SONG _ LENGTH is playing time in contracts (play progress).
As can be seen, there are no fields for transmitting the lyrics, and the lyrics are transmitted in one of the fields, so that at least two display types exist in one data display position of the current display information.
The method specifically comprises the following steps:
step 101, acquiring first script data;
first, first script data, for example, script content, of song information is acquired. The first script data may be obtained from a database or a local storage, and a person skilled in the art may also select another obtaining method according to actual needs, which is not limited in the embodiment of the present invention.
102, analyzing the first script data to generate an acquisition array;
and identifying and analyzing the acquired first script data, and generating an acquisition array according to the acquired song content.
In an embodiment of the present invention, the first script data includes a plurality of identification bits, and the step of analyzing the first script data to generate the collection array includes:
step S1021, analyzing the field corresponding to the identification position in the first script data to generate content data;
the identification position in the first script data corresponds to a field, and the content of a display position of the song display information is contained in the field; different fields can be analyzed by analyzing the fields corresponding to the plurality of identification bits in the first script data, and content data of the same song display information at different display positions can be obtained.
And a substep S1022, generating an acquisition array using the content data as elements.
And taking the obtained content data as an element of the acquisition array, and generating the acquisition array obtained by analyzing the first script content.
In an embodiment of the present invention, the step of analyzing the field corresponding to the identification bit in the first script data to generate content data includes:
substep S10211, acquiring a segmentation string;
the split string may be obtained by a split string function.
And a substep S10212 of analyzing the field using the segmentation string to generate content data.
And (4) segmenting all contents in the field by adopting the segmentation character string, and analyzing the segmented field contents to generate content data.
In an embodiment of the present invention, the server stores history display information, and before the step of parsing the first script data and generating a collection array, the method further includes:
step S1, reading second script data corresponding to historical display information;
the server stores history display information, and in order to save storage space, the server stores at least history display information displayed last time. Before the server analyzes the first script data, the server may first read second script data corresponding to the history display information displayed last time, where the second script data may be obtained from a database or a local storage, and a person skilled in the art may also select another obtaining method according to actual needs, which is not limited in the embodiment of the present invention.
S2, judging whether the first script data and the second script data meet a first preset condition or not;
the first script data and the second script data are both script data corresponding to the song display information, and both have the same type of identification bits. Whether the playing progress corresponding to the identification bits of the playing progress in the first script data and the second script data is the same or not and whether the instantiation marks of the song information are the same or not can be judged. When the playing progress corresponding to the identification bits of the playing progress in the first script data and the second script data is the same and the instantiation marks of the song information are the same, it can be judged that the first script data and the second script data meet a first preset condition, otherwise, it is judged that the first script data and the second script data do not meet the first preset condition.
And S3, if so, adopting the historical display information as the current display information.
If the playing progress corresponding to the identification bits of the playing progress in the first script data and the second script data is the same as the instantiation marks of the song information, the fact that the song of the previous song display information and the song of the current song display information are in the same song area is represented, and the historical display information can be directly returned to serve as the current display information.
Step 103, splitting the first original data of the acquired array to obtain correction data;
after the acquisition array is generated, each variable in the array is first original data, each variable in the acquisition array is data of different display positions which can be displayed, and the first original data corresponds to the content in the field in the first script data, and the first original data needs to be split to obtain correction data.
In an embodiment of the present invention, the splitting the first original data of the acquisition array to obtain the correction data includes:
substep S1031, splitting the first original data of the acquisition array to obtain target data;
and extracting and splitting the first original data in the acquisition array one by one, wherein the split data of each part is target data.
A substep S1032 of judging whether the target data is null;
the data length of the target data can be acquired as a judgment basis through the data length acquisition function, whether the target data is empty can be judged, and whether the target data is the correction data can be determined.
And a substep S1033 of determining the target data as correction data when the target data is not empty.
After the data length of the target data is acquired, when the data length is not zero, that is, the target data is not empty, the target data may be determined as the correction data.
And 104, correcting the current display information according to the correction data.
And dynamically correcting the display information of the current song in the playing process of the song through the correction data.
In an embodiment of the present invention, the step of correcting the current display information according to the correction data includes:
and a substep S1041 of replacing the second original data at the data display position with the correction data, and correcting the current display information.
The data in the data display position in the current display information can acquire second original data through the transfer array, the second original data may have two display types of data due to the characteristics of the transfer array, and the acquired correction data can correct the second original data in the same display position in a replacement mode so as to correct the current display information.
In an embodiment of the present invention, the server is connected to the vehicle-mounted terminal through a bluetooth wireless network, and the method further includes:
and S4, sending the corrected current display information to the vehicle-mounted terminal through the Bluetooth wireless network, wherein the vehicle-mounted terminal is used for displaying the corrected current display information.
The server can establish a communication link with the vehicle-mounted terminal through the Bluetooth wireless network for information interaction, and the establishment process of the communication link is as follows:
the Bluetooth assembly of the vehicle-mounted terminal continuously sends a connection broadcast signal to the server, the server starts a radio frequency receiving window, and when only the radio frequency receiving window of the server is successfully matched with a transmitting window sent by broadcasting, and a radio frequency channel of the broadcasting and a radio frequency channel of the server are the same channel, the server can receive the broadcast signal of the Bluetooth assembly of the vehicle-mounted terminal. The server receives a connection request of the vehicle-mounted terminal, and performs handshake connection with the vehicle through a Bluetooth secret key in the connection request to establish a communication link between the server and the vehicle-mounted terminal.
After the communication link is established, the server can send the corrected current display information to the vehicle-mounted terminal through the communication link of the Bluetooth wireless network, and the vehicle-mounted terminal receives the corrected current display information to identify and display the current display information; the user can also operate the corrected current display information content through the vehicle-mounted terminal, and interaction between the vehicle and the user is increased.
The method comprises the steps of acquiring first script data, analyzing the first script data to generate an acquisition array, splitting first original data of the acquisition array to obtain correction data, and correcting the current display information according to the correction data; and correcting the multimedia display information so that the vehicle-mounted terminal can acquire correct multimedia display information.
In order that the embodiments of the invention may be more apparent to those skilled in the art, the following examples are given:
the example mainly issues identification through a server, and then executes the identification, so that correct information of singers and singer names is analyzed, and correct display can be performed on a music APP (Application) of a vehicle-mounted large screen.
Where this example communicates with a bluetooth wireless network.
In bluetooth SONG information in the bluetooth protocol, information transfer is performed by transferring an array [ a ] = [ ID _ time, ID _ art, ID _ ALBUM, ID _ NUMBER _ OF _ MEDIA, ID _ TOTAL _ NUMBER _ OF _ MEDIA, ID _ GENRE, ID _ SONG _ LENGTH ].
The mobile phone performs transmission strictly according to the transmission specification of the transmission array under normal conditions, for example: ids = [1,2,3,4,5,6,7], texts = [ bad pain, arrests, bad pain, 0, 237218].
However, after the mobile phone is connected with the vehicle-mounted large-screen music APP, the vehicle-mounted Bluetooth lyric mode is opened, at the moment, the corresponding meaning of the field of the transmission array is changed, the lyrics of the song are transmitted in the certain field, and therefore the music APP cannot acquire song information correctly. For example: after the vehicle-mounted Bluetooth lyric mode is started, the following steps are performed: ids = [1,2,3,4,5,6,7], texts = [ OP: jiancheng culture, ayin-tired and painful of love, 0,0, 237218.
In order to be able to correctly identify and update in real time, update corrections may be issued by the server. The processing can be done by the following function:
1) String getContent (), attribute value acquisition function. For example, getContent (ID _ TITLE) returns information of an ID _ TITLE field, and the returned value is "tired of going out of love" in the above-described vehicle lyric mode without bluetooth enabled.
2) String [ ] getsplierchars, gets the split String, returns two splits with values [ '-', '-' ].
3) String [ ] getSplitContent (), the obtained divided character, and the returned value are the divided data. For example, in the above-described vehicle bluetooth lyric mode, getSplitContent (ID _ ARTIST) returns [ a, tired of pain and dislike ].
4) MusicInfo previous MusicInfo, the last matching music information is obtained. Finally, the last matched MusicInfo is returned, and if the previous MusicInfo cannot be matched temporarily, an unknown MusicInfo (each field is empty) is returned, so that the original display information of the music APP is kept unchanged.
First, the script content is obtained from the local storage.
And analyzing the script content according to the keywords of the transmission array to generate an acquisition array. This can be done by the following algorithm:
in addition, in order to adapt to different music playing programs on the mobile phone, the following contents can be added:
after the content is analyzed, an acquisition array is generated, and the corresponding correction data can be successfully acquired through dynamic execution and can be executed through the following algorithm.
And after the correction data is obtained, replacing the content of the corresponding field in the MusicInfo information of the current display information in a replacement mode, and correcting and updating the current display information.
And analyzing according to the keywords of the transmission array by acquiring the analysis script content to generate an acquisition array, and processing the acquisition data to obtain the dynamic correction of the correction data and the current display information of the song. The vehicle-mounted terminal can acquire correct song display information.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 2, a block diagram of a data processing apparatus according to an embodiment of the present invention is shown, and is applied to a server, where the server is configured to issue current display information of multimedia, and a data display position of the current display information has at least two display types, and the apparatus may specifically include the following modules:
an obtaining module 201, configured to obtain first script data;
the analysis module 202 is configured to analyze the first script data to generate an acquisition array;
the splitting module 203 is configured to split the first original data of the acquired array to obtain correction data;
and the correcting module 204 is configured to correct the current display information according to the correction data.
In an embodiment of the present invention, the first script data includes a plurality of identification bits, and the parsing module 202 includes:
the analysis submodule is used for analyzing the field corresponding to the identification bit in the first script data to generate content data;
and the generation submodule is used for generating a collection array by taking the content data as an element.
In an embodiment of the present invention, the parsing submodule includes:
a split character string acquisition unit for acquiring a split character string;
and the segmentation unit is used for analyzing the field by adopting the segmentation character string to generate content data.
In an embodiment of the present invention, the server stores history display information thereon, and the apparatus further includes:
the reading module is used for reading second script data corresponding to the historical display information;
the first judging module is used for judging whether the first script data and the second script data meet a first preset condition or not;
and the history display module is used for adopting the history display information as the current display information if the first script data and the second script data meet a first preset condition.
In an embodiment of the present invention, the splitting module 203 includes:
the splitting submodule is used for splitting the first original data of the acquisition array to obtain target data;
the second judgment submodule is used for judging whether the target data is empty or not;
and the determining module is used for determining the target data as correction data when the target data is not empty.
In one embodiment of the present invention, the correction module 204 comprises:
and the correction submodule is used for replacing the second original data of the data display position with the correction data and correcting the current display information.
In an embodiment of the present invention, the server is connected to the vehicle-mounted terminal through a bluetooth wireless network, and the apparatus further includes:
and the sending module is used for sending the corrected current display information to the vehicle-mounted terminal through the Bluetooth wireless network, and the vehicle-mounted terminal is used for displaying the corrected current display information.
For the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
An embodiment of the present invention further provides a vehicle, including:
one or more processors; and
one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the vehicle to perform one or more methods as described above.
Embodiments of the invention also provide one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform one or more methods as described above.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "include", "including" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or terminal device including a series of elements includes not only those elements but also other elements not explicitly listed or inherent to such process, method, article, or terminal device. Without further limitation, an element defined by the phrases "comprising one of \ 8230; \8230;" does not exclude the presence of additional like elements in a process, method, article, or terminal device that comprises the element.
The above detailed description is provided for a data processing method and a data processing apparatus, and the specific examples are applied herein to explain the principles and embodiments of the present invention, and the descriptions of the above embodiments are only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.