Text chat record reconstruction method and device, server and storage medium
Through the Accessibility Service and MediaProjection API, chat records are reconstructed, and the difficulties in extracting and reconstruction of chat records in the existing technology are solved, and a flexible and privacy-protected chat record preservation method is realized.
Patent Information
- Application Number
- CN202411531899.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-03-04
AI Technical Summary
In the existing Android operating system, it is difficult to directly extract and backup the conversation content of chat applications, and the application scope of OCR technology is limited, which makes the extraction and reconstruction of conversation information a difficult point.
By calling Accessibility Service to listen to the input box of the target application, obtaining the change of the input box; if it is determined that the message sending operation is performed, the MediaProjection API is called to perform the screenshot, obtain the target screenshot, and reconstruct the chat record based on the screenshot.
It realizes seamless integration and automatically monitors input box changes, and users do not need additional operations, protects user privacy, does not rely on specific chat applications, and is widely used in chat software on Android devices.
Smart Images

Figure CN119557161A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method, device, server and storage medium for reconstructing text chat records. Background Art
[0002] In the existing Android operating system, in information-sensitive scenarios, such as conversation content in chat applications, it is difficult to directly extract and back up.
[0003] Text extraction based on OCR (Optical Character Recognition) technology has a limited application scope, and the extraction and reconstruction of dialogue information has become a difficulty. A new technical means is needed to solve the above technical problems. Summary of the invention
[0004] The main purpose of the present invention is to solve the technical problem that the method for preserving chat records lacks flexibility.
[0005] A first aspect of the present invention provides a method for reconstructing a text chat record, the method comprising:
[0006] Call Accessibility Service to monitor the input box of the target application and obtain changes in the input box;
[0007] If it is determined that the message sending operation is performed according to the change of the input box, the MediaProjectionAPI is called to perform the screenshot operation to obtain the target screenshot;
[0008] Reconstruct the chat history based on the target screenshot.
[0009] Optionally, in a first implementation of the first aspect of the present invention, the step of calling AccessibilityService to monitor the input box of the target application and obtaining changes in the input box includes:
[0010] Detecting whether the foreground application is the target application;
[0011] If the foreground application is the target application, the Accessibility Service is called to monitor the input box of the target application to obtain changes in the input box.
[0012] Optionally, in a second implementation of the first aspect of the present invention, the step of detecting whether the foreground application is the target application includes:
[0013] When a window switching operation is detected, the package name of the foreground application is obtained;
[0014] The package name is compared with a preset package name in a preset target application list to determine whether the foreground application is the target application.
[0015] Optionally, in a third implementation manner of the first aspect of the present invention, the step of generating message data according to the target screenshot includes:
[0016] Performing a feature extraction operation on the target screenshot to obtain avatar information, message bubble and the message sending time;
[0017] Determine the message sending direction according to the position information of the message bubble in the target screenshot, obtain text information according to the message bubble, and determine the participant identity information according to the avatar information;
[0018] The text information, the message sending direction, the message sending time and the identity information of the message participants are used as the message data.
[0019] Optionally, in a fourth implementation manner of the first aspect of the present invention, the step of using the text information, the message sending direction, the message sending time, and the message participant identity information as the message data includes:
[0020] A structural operation is performed on the text information, the message sending direction, the message sending time, and the identity information of the message participants to obtain the message data.
[0021] Optionally, in a fifth implementation manner of the first aspect of the present invention, the step of acquiring text information according to the message bubble includes:
[0022] A text extraction operation is performed on the message bubble to obtain the text information corresponding to the message bubble.
[0023] Optionally, in a sixth implementation of the first aspect of the present invention, if it is determined that a message sending operation is performed according to the change of the input box, calling a MediaProjection API to perform a screenshot operation, the step of obtaining a target screenshot includes:
[0024] If it is determined that the message sending operation is performed according to the change of the input box, the MediaProjectionAPI is called to perform the screenshot operation to obtain the screenshot to be processed;
[0025] Performing a data preprocessing operation of image enhancement on the screenshot to be processed to obtain the target screenshot.
[0026] A second aspect of the present invention provides a text chat record reconstruction device, comprising a memory and a processor, wherein the processor is used to execute program instructions stored in the memory so that the text chat record reconstruction device performs the above-mentioned text chat record reconstruction method.
[0027] A third aspect of the present invention provides a server, characterized in that it includes a memory and a processor, and the processor is used to execute program instructions stored in the memory so that the server executes the above-mentioned text chat record reconstruction method.
[0028] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned method for reconstructing text chat records.
[0029] In an embodiment of the present invention, the Accessibility Service is called to monitor the input box of the target application to obtain changes in the input box; if it is determined that a message sending operation has been performed based on the changes in the input box, the MediaProjection API is called to perform a screenshot operation to obtain a target screenshot; based on the target screenshot, the chat record is reconstructed. The Accessibility Service and MediaProjection API are native components of the Android operating system, which enables the method to be seamlessly integrated without the need for invasive modifications to the operating system or applications. By automatically monitoring changes in the input box to determine message sending, the user does not need to perform additional operations. The method does not need to send data to an external server for processing, which better protects the user's privacy. The method does not rely on a specific chat application and can be widely used in chat software running on Android devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of an embodiment of a method for reconstructing text chat records in an embodiment of the present invention;
[0031] Figure 2 This is a schematic diagram of a specific embodiment of step 101 of the method for reconstructing text chat records in an embodiment of the present invention;
[0032] Figure 3 This is a schematic diagram of a specific embodiment of step 101 of the method for reconstructing text chat records in an embodiment of the present invention;
[0033] Figure 4 A schematic diagram of an embodiment of a device for reconstructing text chat records in an embodiment of the present invention;
[0034] Figure 5FIG. 1 is a schematic diagram of an embodiment of a server in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The embodiments of the present invention provide a text chat record reconstruction method, device, server and storage medium.
[0036] The embodiments disclosed in the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments disclosed in the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments disclosed in the present invention are only for exemplary purposes and are not intended to limit the scope of protection disclosed in the present invention.
[0037] In the description of the embodiments disclosed in the present invention, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0038] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the method for reconstructing text chat records in an embodiment of the present invention includes:
[0039] 101. Call Accessibility Service to monitor the input box of the target application and obtain changes in the input box;
[0040] Specifically, the text chat record reconstruction device detects whether the application currently running in the foreground is a preset target application (such as WeChat, WhatsApp, etc.). This can be achieved through an operating system API or a specific service, such as Android's ActivityManager.
[0041] After confirming that the foreground application is the target application, verify whether the screenshot permission of the application has been obtained. The screenshot permission is usually obtained through user authorization when the application is first run, such as the permission applied through the MediaProjection API.
[0042] Confirm that you have the screenshot permission and the foreground application is the target application. The reconstruction device of the text chat history listens to the input box of the application. You can access the UI components of the application and set the listener to capture the changes in the input box content. The listener can capture the text entered by the user, the changes in the cursor position, etc., so as to obtain the changes in the input box.
[0043] 102. If it is determined that a message sending operation is performed according to the change of the input box, calling a MediaProjection API to perform a screenshot operation to obtain a target screenshot;
[0044] Specifically, by analyzing the changes in the input box, the text chat record reconstruction device determines whether the user has executed a message sending operation. Specific user interaction modes may be checked, such as clicking a send button, pressing an enter key, or clearing the text box content.
[0045] When it is determined that the user has executed a message sending operation, the reconstruction device of the text chat record executes a screen capture operation, which can be implemented through the screen capture API of the operating system, such as the MediaProjection API of Android.
[0046] After the screenshot operation is completed, the text chat record reconstruction device obtains a screenshot containing the current screen content, namely the target screenshot. The target screenshot will be used for subsequent message data generation.
[0047] Optionally, if it is determined that a message sending operation has been performed based on the change in the input box, the MediaProjection API is called to perform a screenshot operation to obtain a screenshot to be processed; an image enhancement data preprocessing operation is performed on the screenshot to be processed to obtain the target screenshot. Among them, the target screenshot serves as the basis for generating chat records, and its quality directly affects the extraction and accuracy of subsequent message data. Through the image enhancement operation, key parameters such as clarity, contrast, and brightness of the target screenshot are significantly improved, making key information such as text, avatars, timestamps, etc. in the screenshot clearer and easier to distinguish. It not only ensures the accurate extraction of message data, but also avoids chat record errors caused by blurred screenshots or incomplete information.
[0048] 103. Reconstruct the chat record according to the target screenshot;
[0049] Specifically, the text chat record reconstruction device performs a feature extraction operation on the target screenshot to identify information directly related to the chat message, including avatar information, message bubbles, message sending time, etc. Feature extraction is implemented based on image processing technology, such as edge detection, contour extraction, etc.
[0050] Based on the extracted feature information, the text chat record reconstruction device generates message data. The message data includes information on the direction of message sending (sender or receiver), identity information of message participants (such as avatars or nicknames), text information (including the text content sent by the user), and the time when the message was sent. The message data is stored in a structured format for subsequent processing.
[0051] Specifically, the text chat record reconstruction device stores the generated message data in a preset message database. The message database can be a relational database, a non-relational database, or any other type of data storage system. When storing, the message data is arranged in chronological order to facilitate subsequent query and reconstruction of the chat record.
[0052] By querying and combining the message data in the message database, the text chat record reconstruction device can reconstruct the complete chat record, including arranging the messages in chronological order, displaying the sender and receiver of the message, the message content and the sending time, etc. The reconstructed chat record can be presented to the user in a variety of forms, such as text form, graphical interface form, etc.
[0053] In an embodiment of the present invention, the Accessibility Service is called to monitor the input box of the target application to obtain changes in the input box; if it is determined that a message sending operation has been performed based on the changes in the input box, the MediaProjection API is called to perform a screenshot operation to obtain a target screenshot; based on the target screenshot, the chat record is reconstructed. The Accessibility Service and MediaProjection API are native components of the Android operating system, which enables the method to be seamlessly integrated without the need for invasive modifications to the operating system or applications. By automatically monitoring changes in the input box to determine message sending, the user does not need to perform additional operations. The method does not need to send data to an external server for processing, which better protects the user's privacy. The method does not rely on a specific chat application and can be widely used in chat software running on Android devices.
[0054] In the existing text chat record reconstruction methods, some methods blindly start the monitoring service without a clear target application, resulting in a large amount of system resources being occupied, affecting the overall performance of the device and user experience. Due to the lack of optimization for specific applications, these methods may have a delay when capturing changes in the input box, resulting in a slow response speed of the message sending operation. Based on this, the present invention proposes an optional embodiment.
[0055] Reference Figure 2 , Figure 2 This is a schematic diagram of a specific embodiment of step 101 of the method for reconstructing text chat records in an embodiment of the present invention. Step 101 also includes the following specific implementation methods:
[0056] 1011. Detect whether the foreground application is the target application;
[0057] 1012. If the foreground application is the target application, call Accessibility Service to monitor the input box of the target application to obtain changes in the input box.
[0058] Specifically, it is detected whether the current foreground application is the target application. This can be achieved by monitoring the window switching operation of the system, wherein the reconstruction device of the text chat record will obtain the content of the current interface, such as the application package name or interface elements.
[0059] After confirming that the foreground application is the target application, the Accessibility Service is called to monitor the input box of the target application. This allows the reconstruction device of the text chat history to capture all changes in the input box, such as the input and deletion of text.
[0060] By monitoring, you can get detailed data about the user's interaction with the application in real time, especially the changes in the input box when the user sends a message.
[0061] In steps 1011-1013, by activating the Accessibility Service only when the foreground application is determined to be the target application, monitoring of non-target applications is reduced, system resources are saved, and the relevance and accuracy of monitoring are improved.
[0062] In actual applications, users may frequently switch between different applications or different interfaces within applications. Due to the wide variety of applications and different interfaces, an accurate method is needed to identify the target application that needs to be monitored and avoid unnecessary monitoring or interference on irrelevant applications. At the same time, it is also necessary to efficiently process the captured input box changes to ensure real-time performance and accuracy. To this end, the present invention provides an optional embodiment.
[0063] Reference Figure 3 , Figure 3 This is a schematic diagram of a specific embodiment of step 1011 of the method for reconstructing text chat records in an embodiment of the present invention. Step 1011 also includes the following specific implementation methods:
[0064] 10111. When a window switching operation is monitored, obtain the package name of the foreground application;
[0065] 10112. Compare the package name with a preset package name in a preset target application list to determine whether the foreground application is the target application.
[0066] Specifically, use Accessibility Service to monitor the window switching events of the Android system. You can register an Accessibility Service and override the onAccessibilityEvent method in it to capture events.
[0067] When a window switch occurs (for example, the user switches to another application or another interface within the application), an AccessibilityEvent is triggered, and its event type is TYPE_WINDOW_STATE_CHANGED or similar types, indicating that the window state has changed.
[0068] In the onAccessibilityEvent method, check whether the captured event type is a window switching event.
[0069] If so, use the information provided by the AccessibilityEvent object to obtain the content of the current interface. This includes the package name, class name, title of the window, and detailed information of elements on the interface (such as text boxes, buttons, etc.). Specifically, create a class that inherits from AccessibilityService. Declare this service in AndroidManifest.xml and configure the required permissions and accessibility-service configuration. Override the onAccessibilityEvent method, which is called when an accessibility event is received. Extract the package name, class name and other information of the window from the AccessibilityEvent object. Define a list containing the package names of target applications. In the onAccessibilityEvent method, compare the captured package name with the preset target application list. Based on the comparison results, perform corresponding operations, such as recording logs, displaying notifications, executing automated tasks, etc.
[0070] The obtained current interface content is compared with a preset target application list or identifier. The target application list may include package names or class names of multiple applications that the user wants to monitor.
[0071] If the package name or class name of the current interface matches an entry in the target application list, the foreground application is determined to be the target application.
[0072] In steps 10111-10112, by monitoring the window switching operation, the foreground application can be dynamically identified and monitored without knowing the detailed information of the application in advance or performing complex configuration. This enables the text chat record reconstruction device to flexibly adapt to different application scenarios and target applications. By checking the package name or class name of the window to confirm whether the foreground application is the target application, the application to be monitored can be more accurately identified. Invalid monitoring caused by misjudgment is avoided.
[0073] Traditional chat record reconstruction methods may rely on manual input or importing of chat record files. These methods have many shortcomings, such as time-consuming and labor-intensive, prone to errors, etc. To this end, the present invention provides an optional embodiment.
[0074] Step 103 also includes the following specific implementations:
[0075] 1031. Perform a feature extraction operation on the target screenshot to obtain avatar information, message bubble, and message sending time;
[0076] 1032. Determine the message sending direction according to the position information of the message bubble in the target screenshot, obtain text information according to the message bubble, and determine the participant identity information according to the avatar information;
[0077] 1033. Use the text information, the message sending direction, the message sending time, and the identity information of the message participants as the message data.
[0078] Specifically, a target screenshot obtained through the MediaProjection API is received. Then, feature extraction is performed on the target screenshot using image processing techniques (such as edge detection, image segmentation, etc.). The specific content of feature extraction includes avatar information (such as the position and features of the user's avatar), message bubble (the area containing text information), and message sending time (such as timestamp or relative time).
[0079] According to the position information of the message bubble in the target screenshot, it can be judged whether the message is sent from left to right or from right to left, thereby determining the message sending direction.
[0080] Next, a text extraction operation is performed on the message bubble area, and the text information in the message bubble is obtained using optical character recognition (OCR) technology.
[0081] By matching the avatar information with a preset user avatar database, the identity information of the sender or receiver of the message can be determined.
[0082] The extracted text information, message sending direction, message sending time and message participant identity information are taken as components of the message data, and these information are integrated and structured to form a complete message data record.
[0083] Optionally, a structured operation is performed on the text information, the message sending direction, the message sending time, and the identity information of the message participants to obtain the message data. The structured operation enables the data in the chat record to be stored according to a certain format and standard. The standardized data format can reduce the complexity of data processing and improve the efficiency and accuracy of data processing.
[0084] Optionally, a structural operation is performed on the text information, the message sending direction, the message sending time and the identity information of the message participants to obtain the message data. Among them, by performing a special text extraction operation on the message bubble, the key information in the message can be accurately captured.
[0085] In steps 1014-1015, through feature extraction and text extraction operations, key information such as text content, sending direction, sending time and participant identity can be accurately obtained from the target screenshot, thereby ensuring the accuracy and completeness of the chat record reconstruction.
[0086] It is easy to understand that the terms involved in the reconstruction method of text chat records include but are not limited to:
[0087] Accessibility Service: Through Accessibility Service, applications can monitor and simulate user interaction operations, such as clicks and slides, and can also obtain content information on the screen.
[0088] MediaProjection API: An API provided by the Android system that allows applications to capture the device's screen content and project or record it.
[0089] Message sending operation: the user clicks the send button in the chat application to send the text content in the input box to the recipient.
[0090] Feature extraction operation: Feature extraction operation is the process of extracting useful information or features from images or text. In chat record reconstruction, feature extraction may include extracting information such as avatars, message bubbles, and message sending time.
[0091] Message bubble: A message bubble is a graphic element on the chat interface used to display the content of a message. It usually contains the sender's text information, timestamp, etc.
[0092] Message sending direction: The message sending direction refers to which party the message is sent from to another party. In the chat application of the present invention, it is indicated by the position or direction of the message bubble.
[0093] Structuring operation: Structuring operation is the process of converting unstructured data (such as text, images, etc.) into structured data formats (such as database tables, JSON, etc.). In chat record reconstruction, structuring operations may include storing extracted text information, message sending direction, time, etc. as structured message data.
[0094] Reference Figure 4 , the embodiment of the present disclosure provides a text chat record reconstruction device 400, including a text chat record reconstruction device body, and a text chat record reconstruction device 405. The text chat record reconstruction device 405 includes a processor (processor) 404 and a memory (memory) 401 storing program instructions. Optionally, the device may also include a communication interface (Communication Interface) 402 and a bus 403. Among them, the processor 404, the communication interface 402, and the memory 401 can complete mutual communication through the bus 403. The communication interface 402 can be used for information transmission. The processor 404 can call the program instructions in the memory 401 to execute the text chat record reconstruction method of the above embodiment. In addition, the logical instructions in the above-mentioned memory 401 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. The memory 401, as a computer-readable storage medium, can be used to store software programs, computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 404 executes the function application and data processing by running the program instructions / modules stored in the memory 401, that is, the reconstruction method of the text chat record in the above embodiment is realized. The memory 401 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 401 may include a high-speed random access memory and may also include a non-volatile memory.
[0095] Reference Figure 5, the embodiment of the present disclosure provides a server 500, including a processor (processor) 504 and a memory (memory) 501 storing program instructions. Optionally, the server may also include a communication interface (CommunicationInterface) 502 and a bus 503. Among them, the processor 504, the communication interface 502, and the memory 501 can communicate with each other through the bus 503. The communication interface 502 can be used for information transmission. The processor 504 can call the program instructions in the memory 501 to execute the text chat record reconstruction method of the above embodiment.
[0096] In addition, the logic instructions in the above-mentioned memory 501 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. The memory 501, as a computer-readable storage medium, can be used to store software programs, computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 504 executes functional applications and data processing by running the program instructions / modules stored in the memory 501, that is, the reconstruction method of the text chat record in the above-mentioned embodiment is realized. The memory 501 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 501 may include a high-speed random access memory and may also include a non-volatile memory.
[0097] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
[0098] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0099] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0100] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0101] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for reconstructing text chat records, characterized in that: The text chat record reconstruction method comprises: Call Accessibility Service to monitor the input box of the target application and obtain changes in the input box; If it is determined that the message sending operation is performed according to the change of the input box, the MediaProjection API is called to perform a screenshot operation to obtain a target screenshot; Reconstruct the chat history based on the target screenshot.
2. The text chat record reconstruction method according to claim 1, characterized in that: The step of calling the Accessibility Service to monitor the input box of the target application and obtaining the change of the input box includes: Detecting whether the foreground application is the target application; If the foreground application is the target application, the Accessibility Service is called to monitor the input box of the target application to obtain changes in the input box.
3. The text chat record reconstruction method according to claim 2, characterized in that: The step of detecting whether the foreground application is the target application comprises: When a window switching operation is detected, the package name of the foreground application is obtained; The package name is compared with a preset package name in a preset target application list to determine whether the foreground application is the target application.
4. The text chat record reconstruction method according to claim 1, characterized in that: The step of generating message data according to the target screenshot comprises: Performing a feature extraction operation on the target screenshot to obtain avatar information, message bubble and the message sending time; Determine the message sending direction according to the position information of the message bubble in the target screenshot, obtain text information according to the message bubble, and determine the participant identity information according to the avatar information; The text information, the message sending direction, the message sending time and the identity information of the message participants are used as the message data.
5. The text chat record reconstruction method according to claim 4, characterized in that: The step of using the text information, the message sending direction, the message sending time, and the message participant identity information as the message data comprises: A structural operation is performed on the text information, the message sending direction, the message sending time, and the identity information of the message participants to obtain the message data.
6. The text chat record reconstruction method according to claim 4, characterized in that: The step of obtaining text information according to the message bubble comprises: A text extraction operation is performed on the message bubble to obtain the text information corresponding to the message bubble.
7. The text chat record reconstruction method according to claim 1, characterized in that: If it is determined that a message sending operation is performed according to the change of the input box, then the MediaProjection API is called to perform a screenshot operation, and the step of obtaining a target screenshot includes: If it is determined that the message sending operation is performed according to the change of the input box, the MediaProjection API is called to perform a screenshot operation to obtain a screenshot to be processed; Performing a data preprocessing operation of image enhancement on the screenshot to be processed to obtain the target screenshot.
8. A device for reconstructing text chat records, characterized in that: It comprises a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the text chat record reconstruction method according to any one of claims 1 to 7.
9. A server, characterized in that: It comprises a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the text chat record reconstruction method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for reconstructing a text chat record according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Chat record screenshot processing method and device, computer equipment and storage medium
CN111985467A
Implementation method and system supporting master screen mode and remote control
CN116828029A
Chat summary generation method and device, storage medium and computer equipment
CN116933739A
Method and apparatus for forwarding chat information, and electronic device
WO2019085600A1
Cited By
Clothing change identification method and system, electronic equipment and storage medium
CN120656150A