Data conversion and filtering method, device and computer readable storage medium
By receiving server data on the user side and performing message template conversion and preset filtering rules processing, the diverse UI structures and filtering problems in the robot intelligent question-and-answer system are solved, and the efficient, accurate and easy-to-scaling effects of data conversion and filtering are achieved.
Patent Information
- Application Number
- CN202011644302.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2040-12-30
AI Technical Summary
In the robot intelligent question and answer system, the UI structure of the reply content returned by the server is diverse, resulting in the user side needing to adapt to multiple style templates, which increases the workload and management costs. At the same time, the filtering of specific messages or sensitive content is difficult to be carried out accurately and efficiently.
By receiving data sent by the server, converting it according to the message template, filtering and marking the data according to the preset filtering rules, sending data with custom tags to the user for filtering and storage.
It reduces the workload and management costs of the user side, improves the accuracy and efficiency of data conversion and filtering, and is easy to optimize and scale.
Smart Images

Figure CN112632041B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to big data processing, and in particular to a data conversion and filtering method, an electronic device and a computer-readable storage medium. Background Art
[0002] At present, when doing robot intelligent question and answer, the server will give different forms of answers according to the diversity of the user's questions. Their UI structures are different, and the user needs to adapt to multiple sets of style templates. The usual practice is that the server returns the answer type identifier and original data, and the user renders the corresponding message template according to the answer type. This solution has the following defects:
[0003] First, all message templates are on the user side, which has poor reusability. Since each reply type requires different processing, as the number of reply types increases, the user side will continue to add corresponding new message templates, which increases the workload and management cost of the user side.
[0004] Second, for certain historical messages, it is often necessary to filter some specific messages or sensitive content in the messages before displaying them to the user end. For example, a historical message is a question and answer about checking the account balance. When the user queries the historical message, due to the change in the account balance value, it is necessary to filter the value of the account balance in the historical message before displaying the historical message. Since the types of sensitive content in specific messages or messages are many and complex, filtering specific messages or sensitive content in messages through the user end will increase the workload of the user end, while the server directly filters the original message data, and the difference in data before and after filtering may cause errors in the filtered content.
[0005] Therefore, how to achieve data conversion and filtering accurately, concisely and efficiently has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] In view of the above, it is necessary to provide a data conversion and filtering method for accurately, concisely and efficiently realizing data conversion and filtering.
[0007] The data conversion and filtering method provided by the present invention is applied to an electronic device, comprising:
[0008] Receive first data sent by the server, obtain a message template corresponding to the first data, and convert the first data into second data according to the message template;
[0009] Filtering the data to be filtered in the second data according to a preset filtering rule, and adding a preset custom tag to the data to be filtered in the second data;
[0010] The second data including the data to be filtered with the custom tag is sent to the user end, and after removing or replacing the data to be filtered with the custom tag in the second data, the second data with the custom tag added is stored as a historical message.
[0011] Optionally, the first data is in json format; the second data is in html format.
[0012] Optionally, the receiving first data sent by the server, acquiring a message template corresponding to the first data, and converting the first data into second data according to the message template includes:
[0013] Forwarding the request message sent by the user end to the server end, and receiving the first data returned by the server end according to the request message;
[0014] Acquire a message template corresponding to the template attribute of the first data from a preset message template according to the template attribute of the first data;
[0015] The first data is converted into second data according to the message template.
[0016] Optionally, after receiving the second data, the user terminal displays the second data through a DOM container.
[0017] Optionally, after receiving a query request for historical messages sent by the user terminal, a historical message corresponding to the query request is obtained from the stored historical messages and sent to the user terminal.
[0018] In addition, to achieve the above-mentioned purpose, the present invention further provides an electronic device, which includes: a memory and a processor, wherein the memory stores a data conversion and filtering program that can be run on the processor, and when the data conversion and filtering program is executed by the processor, the following steps are implemented:
[0019] Receive first data sent by the server, obtain a message template corresponding to the first data, and convert the first data into second data according to the message template;
[0020] Filtering the data to be filtered in the second data according to a preset filtering rule, and adding a preset custom tag to the data to be filtered in the second data;
[0021] The second data including the data to be filtered with the custom tag is sent to the user end, and after removing or replacing the data to be filtered with the custom tag in the second data, the second data with the custom tag added is stored as a historical message.
[0022] Optionally, the first data is in json format; the second data is in html format.
[0023] Optionally, the receiving first data sent by the server, acquiring a message template corresponding to the first data, and converting the first data into second data according to the message template includes:
[0024] Forwarding the request message sent by the user end to the server end, and receiving the first data returned by the server end according to the request message;
[0025] Acquire a message template corresponding to the template attribute of the first data from a preset message template according to the template attribute of the first data;
[0026] The first data is converted into second data according to the message template.
[0027] Optionally, after receiving a query request for historical messages sent by the user terminal, a historical message corresponding to the query request is obtained from the stored historical messages and sent to the user terminal.
[0028] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, including a data storage area and a program storage area, the data storage area stores data created according to the use of the blockchain node, and the program storage area stores a data conversion and filtering program; wherein the data conversion and filtering program can be executed by one or more processors to implement the steps of the above-mentioned data conversion and filtering method.
[0029] Compared with the prior art, the present invention receives the first data sent by the server, converts the first data into the second data according to the message template corresponding to the first data, filters out the data to be filtered in the second data according to the preset filtering rules and adds a preset custom tag, sends the second data containing the data to be filtered with the custom tag to the user end, filters the second data with the custom tag according to the custom tag, and stores the filtered second data as a historical message. This method uses an electronic device to render the data sent by the server with a message template and filters the stored historical messages, which reduces the workload of the user end and is easy to optimize. The message template and filtering rules can be freely expanded according to actual needs, thereby realizing data conversion and filtering more accurately, concisely and efficiently. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a schematic diagram of an electronic device according to an embodiment of the present invention;
[0031] Figure 2 for Figure 1 A program module diagram of an embodiment of a data conversion and filtering program in FIG.
[0032] Figure 3 The flowchart of one embodiment of the data conversion and filtering method of the present invention.
[0033] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0035] It should be noted that the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0036] like Figure 1 FIG. 1 is a schematic diagram of an embodiment of an electronic device 1 of the present invention. The electronic device 1 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. The electronic device 1 can be a computer, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of hosts or network servers, wherein cloud computing is a type of distributed computing, a super virtual computer composed of a group of loosely coupled computer sets.
[0037] In this embodiment, the electronic device 1 includes, but is not limited to, a memory 11, a processor 12, and a network interface 13 that can be interconnected and communicated via a system bus. The memory 11 stores a data conversion and filtering program 10 that can be executed by the processor 12. Figure 1 Only the electronic device 1 having components 11-13 and the data conversion and filtering program 10 is shown. It can be understood by those skilled in the art that Figure 1 The structure shown does not constitute a limitation on the electronic device 1 , and the electronic device 1 may include fewer or more components than shown in the figure, or combine some components, or arrange the components differently.
[0038] The memory 11 includes a memory and at least one type of readable storage medium. The memory provides a cache for the operation of the electronic device 1; the readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1; in other embodiments, the non-volatile storage medium may also be an external storage device of the electronic device 1, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. In this embodiment, the readable storage medium of the memory 11 mainly includes a program storage area and a data storage area, wherein the program storage area is generally used to store an operating system and various application software installed on the electronic device 1, such as storing the code of the data conversion and filtering program 10 in one embodiment of the present invention; the data storage area can store data created according to the use of the blockchain node, such as various types of data that have been output or are to be output.
[0039] The processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 12 is generally used to control the overall operation of the electronic device 1, such as performing control and processing related to data interaction or communication with other devices. In this embodiment, the processor 12 is used to run the program code stored in the memory 11 or process data, such as running the data conversion and filtering program 10.
[0040] The network interface 13 may include a wireless network interface or a wired network interface, and the network interface 13 is used to establish a communication connection between the electronic device 1 and a client (not shown in the figure).
[0041] Optionally, the electronic device 1 may further include a user interface, which may include a display (Display), an input unit such as a keyboard (Keyboard), and the optional user interface may also include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an organic light-emitting diode (Organic Light-Emitting Diode, OLED) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.
[0042] In one embodiment of the present invention, the data conversion and filtering program 10 implements the following steps when executed by the processor 12 .
[0043] Receive first data sent by the server, obtain a message template corresponding to the first data, and convert the first data into second data according to the message template.
[0044] In one embodiment, the electronic device establishes a node intermediate layer between the server and the client, and implements the data conversion and filtering method through the node intermediate layer.
[0045] Specifically, the first data is in json format, and the second data is in html format. The request message sent by the user end is forwarded to the server end, the first data returned by the server end according to the request message is received, and the message template corresponding to the template attribute of the first data is obtained from the pre-set message template according to the template attribute of the first data (i.e., the template field value), and the first data is converted into the second data according to the message template. Among them, the corresponding relationship between the template attribute (i.e., the template field value) and the message template is as follows:
[0046] template field value Pre-set message templates aat_text Text templates aat_image Image Templates imgCardTpl Graphic Template aat_sys System message template businessTypeSel Manual questionnaire template aat_satisfy Satisfaction service template aat_busy Customer service busy template
[0047] In one embodiment, the message template includes three parts: message content, question and answer feedback (e.g., solved, unsolved), and related questions. When the first data is converted into the second data according to the message template, the msgContent field of the first data is converted into message content, and the relatedQuestions field of the first data is converted into related questions. For example:
[0048] The first data is as follows:
[0049] {
[0050] "source": "robot",
[0051] "template": "aat_text",
[0052] "msgDate": 1575352511712,
[0053] "msgId":"",
[0054] "msgInfo": {
[0055] "msgContent": "In addition to the same risks as main board investments, investments in the GEM market also have their own special risks, including risks that may arise from differences in rules. Please pay close attention to the announcements of GEM companies by relevant units, understand the basic situation and risk profile of the company, and make reasonable, legal, and compliant investments."
[0056] "relatedQuestions": ["GEM transfer", "How to make an appointment to open the GEM", "Forgot password"]
[0057] }
[0058] }
[0059] The value of the template field is "aat_text", and the message template corresponding to the value of the template field is a text template. The first data is converted into the second data according to the text template as follows:
[0060]
[0061] Among them, the div tag with class="answer_box" is the message content, the div tag with class="fabulous_con" is the question and answer feedback, and the p tag and ul tag are related questions.
[0062] The data to be filtered in the second data are filtered out according to a preset filtering rule, and a preset custom tag is added to the data to be filtered in the second data.
[0063] In one embodiment, the data to be filtered includes data to be removed and data to be replaced, and the pre-set custom tag includes a type attribute and a value attribute. If the data to be filtered is data to be removed, a custom tag with a type attribute of "remove" is added to the data to be filtered; if the data to be filtered is data to be replaced, a custom tag with a type attribute of "replace" is added to the data to be filtered, and the value of the value attribute is set to the content to be replaced by the data to be filtered. For example:
[0064] The second data is as follows:
[0065]
[0066] Confirm to check your asset information
[0067] <button>Cancel< / button>
[0068] <button>Confirm< / button>
[0069] Your total assets are 88392183.98 yuan
[0070]
[0071] According to the preset filtering rules, the preset custom tags are added to the data to be filtered in the second data as follows:
[0072]
[0073] Confirm to check your asset information
[0074] <pasMessagetype="remove>
[0075] <button>Cancel< / button>
[0076] <button>Confirm< / button>
[0077] < / pasMessage>
[0078] Your total assets<pasMessagetype=\"replace\"value="****">
[0079] 88392183.98 < / pasMessage>Yuan
[0080]
[0081] The second data including the data to be filtered with the custom tag is sent to the user end, and after removing or replacing the data to be filtered with the custom tag in the second data, the second data with the custom tag added is stored as a historical message.
[0082] In one embodiment, after receiving the second data, the user terminal displays the second data through a DOM container.
[0083] In one embodiment, when removing or replacing the data to be filtered in the second data to which the custom tag is added according to the custom tag, the data to be filtered is removed or replaced according to the type attribute of the custom tag: if the type attribute is "remove", the data to be filtered is removed; if the type attribute is "replace", the data to be filtered is replaced with the value of the value attribute. For example:
[0084] The second data of the pre-set custom tag pasMessage is added as follows:
[0085]
[0086] Confirm to check your asset information
[0087] <pasMessagetype="remove>
[0088] <button>Cancel< / button>
[0089] <button>Confirm< / button>
[0090] < / pasMessage>
[0091] Your total assets<pasMessagetype=\"replace\"value="****">
[0092] 88392183.98 < / pasMessage>Yuan
[0093]
[0094] After removing or replacing the data to be filtered in the second data, the stored historical messages are as follows:
[0095]
[0096] Confirm to check your asset information
[0097] Your total assets are **** yuan
[0098]
[0099] In one embodiment, after receiving a request from the user terminal to query historical messages, the stored historical messages are sent to the user terminal.
[0100] It can be seen from the above embodiments that the electronic device 1 proposed in the present invention receives the first data sent by the server, converts the first data into second data according to the message template corresponding to the first data, filters out the data to be filtered in the second data according to the preset filtering rules and adds a preset custom tag, sends the second data containing the data to be filtered with the custom tag to the user end, filters the second data with the custom tag according to the custom tag, and stores the filtered second data as a historical message. This method uses an electronic device to render the data sent by the server with a message template and filters the stored historical messages, which reduces the workload of the user end and is easy to optimize. The message template and filtering rules can be freely expanded according to actual needs, thereby realizing data conversion and filtering more accurately, concisely and efficiently.
[0101] In other embodiments, the data conversion and filtering program 10 can also be divided into one or more modules, one or more modules are stored in the memory 11, and are executed by one or more processors (processor 12 in this embodiment) to complete the present invention. The module referred to in the present invention refers to a series of computer program instruction segments that can perform specific functions, and is used to describe the execution process of the data conversion and filtering program 10 in the electronic device 1.
[0102] like Figure 2 As shown, Figure 1 A program module diagram of an embodiment of a data conversion and filtering program 10 in FIG.
[0103] In one embodiment of the present invention, the data conversion and filtering program 10 includes a conversion module 110, a screening module 120 and a filtering module 130, illustratively:
[0104] The conversion module 110 is used to receive first data sent by the server, obtain a message template corresponding to the first data, and convert the first data into second data according to the message template;
[0105] The filtering module 120 is used to filter out the data to be filtered in the second data according to a preset filtering rule, and add a preset custom tag to the data to be filtered in the second data;
[0106] The filtering module 130 is used to send the second data including the data to be filtered with the custom tag to the user end, and after removing or replacing the data to be filtered with the custom tag in the second data, store the second data with the custom tag added as a historical message.
[0107] The functions or operation steps implemented when the program modules such as the conversion module 110 , the screening module 120 and the filtering module 130 are executed are substantially the same as those in the above-mentioned embodiment, and will not be described in detail herein.
[0108] like Figure 3 FIG. 1 is a flow chart of an embodiment of a data conversion and filtering method of the present invention. The data conversion and filtering method includes steps S1 to S3.
[0109] S1. Receive first data sent by a server, obtain a message template corresponding to the first data, and convert the first data into second data according to the message template.
[0110] In one embodiment, the electronic device establishes a node intermediate layer between the server and the client, and implements the data conversion and filtering method through the node intermediate layer.
[0111] Specifically, the first data is in json format, and the second data is in html format. The request message sent by the user end is forwarded to the server end, the first data returned by the server end according to the request message is received, and the message template corresponding to the template attribute of the first data is obtained from the pre-set message template according to the template attribute of the first data (i.e., the template field value), and the first data is converted into the second data according to the message template. Among them, the corresponding relationship between the template attribute (i.e., the template field value) and the message template is as follows:
[0112]
[0113]
[0114] In one embodiment, the message template includes three parts: message content, question and answer feedback (e.g., solved, unsolved), and related questions. When the first data is converted into the second data according to the message template, the msgContent field of the first data is converted into message content, and the relatedQuestions field of the first data is converted into related questions. For example:
[0115] The first data is as follows:
[0116] {
[0117] "source":"robot",
[0118] "template":"aat_text",
[0119] "msgDate":1575352511712,
[0120] "msgId":"",
[0121] "msgInfo":{
[0122] "msgContent":"In addition to the same risks as main board investments, GEM investments also have their own special risks, including risks that may arise from differences in rules. Please pay close attention to the announcements of GEM companies by relevant units, understand the basic situation and risk profile of the companies, and make reasonable, legal, and compliant investments",
[0123] "relatedQuestions":["GEM transfer","How to make an appointment to open the GEM","Forgot password"]
[0124] }
[0125] }
[0126] Among them, the template field value is "aat_text", the message template corresponding to the template field value is a text template, and the first data is converted into the second data according to the text template as follows:
[0127]
[0128]
[0129] Among them, the div tag with class="answer_box" is the message content, the div tag with class="fabulous_con" is the question and answer feedback, and the p tag and ul tag are related questions.
[0130] S2. Filter out the data to be filtered in the second data according to a preset filtering rule, and add a preset custom tag to the data to be filtered in the second data.
[0131] In one embodiment, the data to be filtered includes data to be removed and data to be replaced, and the pre-set custom tag includes a type attribute and a value attribute. If the data to be filtered is data to be removed, a custom tag with a type attribute of "remove" is added to the data to be filtered; if the data to be filtered is data to be replaced, a custom tag with a type attribute of "replace" is added to the data to be filtered, and the value of the value attribute is set to the content to be replaced by the data to be filtered. For example:
[0132] The second data is as follows:
[0133]
[0134] Confirm to query your asset information
[0135] <button> Cancel< / button>
[0136] <button> confirm< / button>
[0137] Your total assets are 88392183.98 yuan
[0138]
[0139] According to the preset filtering rules, the preset custom tags are added to the data to be filtered in the second data as follows:
[0140]
[0141] S3. Send the second data including the data to be filtered with the custom tag to the user end, and after removing or replacing the data to be filtered with the custom tag in the second data, store the second data with the custom tag added as a historical message.
[0142] In one embodiment, after receiving the second data, the user terminal displays the second data through a DOM container.
[0143] In one embodiment, when removing or replacing the data to be filtered in the second data to which the custom tag is added according to the custom tag, the data to be filtered is removed or replaced according to the type attribute of the custom tag: if the type attribute is "remove", the data to be filtered is removed; if the type attribute is "replace", the data to be filtered is replaced with the value of the value attribute. For example:
[0144] The second data of the pre-set custom tag pasMessage is added as follows:
[0145]
[0146] After removing or replacing the data to be filtered in the second data, the stored historical messages are as follows:
[0147]
[0148] Confirm to query your asset information
[0149] Your total assets are **** yuan
[0150]
[0151] In one embodiment, after receiving a request from the user terminal to query historical messages, the stored historical messages are sent to the user terminal.
[0152] It can be seen from the above embodiments that the data conversion and filtering method proposed in the present invention receives the first data sent by the server, converts the first data into the second data according to the message template corresponding to the first data, filters out the data to be filtered in the second data according to the preset filtering rules and adds a pre-set custom tag, sends the second data containing the data to be filtered with the custom tag to the user end, filters the second data with the custom tag according to the custom tag, and stores the filtered second data as a historical message. This method uses an electronic device to render the data sent by the server with a message template and filters the stored historical messages, which reduces the workload of the user end and is easy to optimize. The message template and filtering rules can be freely expanded according to actual needs, thereby realizing data conversion and filtering more accurately, concisely and efficiently.
[0153] In addition, the embodiment of the present invention also proposes a computer-readable storage medium, which can be any one or any combination of a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, etc. The computer-readable storage medium includes a data conversion and filtering program 10, and the data conversion and filtering program 10 implements the following operations when executed by a processor:
[0154] A1. Receive first data sent by a server, obtain a message template corresponding to the first data, and convert the first data into second data according to the message template;
[0155] A2. Filtering the data to be filtered in the second data according to a preset filtering rule, and adding a preset custom tag to the data to be filtered in the second data;
[0156] A3. Send the second data including the data to be filtered with the custom tag to the user end, and after removing or replacing the data to be filtered with the custom tag in the second data, store the second data with the custom tag added as a historical message.
[0157] The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the specific implementation of the above-mentioned data conversion and filtering method and electronic device, and will not be described in detail herein.
[0158] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0159] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0161] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0162] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A data conversion and filtering method, applied to an electronic device, characterized in that: The method comprises: Receive first data sent by the server, obtain a message template corresponding to the first data, and convert the first data into second data according to the message template; Filtering the data to be filtered in the second data according to a preset filtering rule, and adding a preset custom tag to the data to be filtered in the second data; The second data including the data to be filtered with the custom tag added is sent to the user end, and after removing or replacing the data to be filtered with the custom tag added in the second data, the second data with the custom tag added is stored as a historical message.
2. The data conversion and filtering method according to claim 1, characterized in that: The first data is in json format; the second data is in html format.
3. The data conversion and filtering method according to claim 1, characterized in that: The receiving first data sent by the server, acquiring a message template corresponding to the first data, and converting the first data into second data according to the message template comprises: Forwarding the request message sent by the user end to the server end, and receiving the first data returned by the server end according to the request message; Acquire a message template corresponding to the template attribute of the first data from a preset message template according to the template attribute of the first data; The first data is converted into second data according to the message template.
4. The data conversion and filtering method according to claim 1, characterized in that: After sending the second data including the data to be filtered with the custom tag added to the user end, the method further includes: After receiving the second data, the user terminal displays the second data including the data to be filtered with the custom tag added through a DOM container.
5. The data conversion and filtering method according to claim 1, characterized in that: Also includes: After receiving a query request for historical messages sent by the user terminal, the historical message corresponding to the query request is obtained from the stored historical messages and sent to the user terminal.
6. An electronic device, characterized in that: The electronic device comprises: a memory and a processor, wherein the memory stores a data conversion and filtering program that can be run on the processor, and when the data conversion and filtering program is executed by the processor, the following steps are implemented: Receive first data sent by the server, obtain a message template corresponding to the first data, and convert the first data into second data according to the message template; Filtering the data to be filtered in the second data according to a preset filtering rule, and adding a preset custom tag to the data to be filtered in the second data; The second data including the data to be filtered with the custom tag added is sent to the user end, and after removing or replacing the data to be filtered with the custom tag added in the second data, the second data with the custom tag added is stored as a historical message.
7. The electronic device according to claim 6, wherein: The first data is in json format; the second data is in html format.
8. The electronic device as claimed in claim 6, wherein: The receiving first data sent by the server, acquiring a message template corresponding to the first data, and converting the first data into second data according to the message template comprises: Forwarding the request message sent by the user end to the server end, and receiving the first data returned by the server end according to the request message; Acquire a message template corresponding to the template attribute of the first data from a preset message template according to the template attribute of the first data; The first data is converted into second data according to the message template.
9. The electronic device as claimed in claim 6, characterized in that: The data conversion and filtering program also includes the following steps: After receiving a query request for historical messages sent by the user terminal, the historical message corresponding to the query request is obtained from the stored historical messages and sent to the user terminal.
10. A computer-readable storage medium, characterized in that: It includes a data storage area and a program storage area, the data storage area stores data created according to the use of the blockchain node, and the program storage area stores a data conversion and filtering program; wherein the data conversion and filtering program can be executed by one or more processors to implement the steps of the data conversion and filtering method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method, electronic device and computer storage medium
CN109522746A
Man-machine interaction reply result determination method and device, and electronic equipment
CN111104506A