Iframe-based signature backtracking method and device, computer equipment and storage medium
By adding plug-ins to the parent window and child window, we collect and send signature event data and generate signature event traceback videos, which solves the problem of iframe pages being unable to be traced back due to cross-domain issues, realizes the traceability function of signatures, and avoids the intrusion of third-party pages. .
Patent Information
- Application Number
- CN202410956173.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-09-24
AI Technical Summary
In the existing technology, cross-domain problems cause the iframe page to be unable to be traced back, making it difficult to implement traceable behavior of signatures. Especially in third-party signature systems or multiple business activities, signature traceability becomes difficult.
By adding plug-ins to the parent window and child window respectively, the child window is embedded in the parent window through an iframe, receives and generates traceback codes and timestamps, collects touch event data, sends it to the backend to generate signature event traceback videos, and responds to the user's signature traceback request for playback Retrace videos, solve cross-domain restrictions, and implement signature traceback.
While keeping the intrusion of third-party pages to a minimum, the problem of iframe pages being unable to be traced back caused by cross-domain was successfully solved, and the traceability function of signatures was realized.
Smart Images

Figure CN118694540A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an iframe-based signature backtracking method, device, computer equipment and storage medium. Background Art
[0002] In existing business behaviors, user signature confirmation is a frequently occurring link. Some business behaviors will use a third-party signature system or multiple business behaviors will reference the same signature system. At this time, the function is often quickly implemented through iframe embedding, but this method will cause cross-domain problems, making it difficult to trace the signature.
[0003] Therefore, in view of the shortcomings of the prior art solutions, the present invention provides an iframe-based signature backtracking method that can achieve cross-domain. Summary of the invention
[0004] Based on this, it is necessary to provide an iframe-based signature backtracking method, device, computer equipment and storage medium to address the above technical problems.
[0005] On the one hand, a signature backtracking method based on iframe is provided, the method comprising:
[0006] Corresponding plug-ins are added to the parent window and the child window respectively, wherein the child window is embedded in the parent window via an iframe; when the parent window and the child window have completed loading the corresponding plug-ins, the child window receives the backtrace code and timestamp sent by the parent window, and generates a child backtrace code; the plug-in corresponding to the child window determines that the touch event in the child window is a signature event, and collects signature event data corresponding to the signature event, wherein the signature event data is associated with the child backtrace code; the plug-in corresponding to the child window sends the signature event data in the child window to the back end, so that the back end generates a corresponding signature event backtrace video according to the received signature event data; in response to a signature backtrace request from the user, the signature event backtrace video corresponding to the signature backtrace request is played.
[0007] Optionally, when the parent window and the child window have completed loading the corresponding plug-ins, the child window receives the backtrace code and timestamp sent by the parent window to generate a child backtrace code, including: after the parent window has completed loading the plug-in corresponding to the parent window, the backtrace code is generated; it is determined whether the child window has completed loading the plug-in corresponding to the child window; if the child window has completed loading the plug-in corresponding to the child window, the parent window sends the backtrace code and the timestamp to the child window, and the child window combines the backtrace code and the timestamp as a child backtrace code; if the child window has not completed loading the plug-in corresponding to the child window, the child window sends a get request to the parent window after loading is completed, and the parent window sends the backtrace and timestamp codes to the child window.
[0008] Optionally, the collecting of signature event data corresponding to the signature event includes: the plug-in corresponding to the sub-window determines the touch type corresponding to the signature event by monitoring the touch events in the sub-window; collecting the signature event data corresponding to the signature event according to the touch type corresponding to the signature event, wherein the touch types include touch start, touch move, and touch end; when the touch type corresponding to the signature event is touch start, recording the initial position data of the touch object; when the touch type corresponding to the signature event is touch move, recording the trajectory coordinates of the moving trajectory on the canvas tag according to the position data of the moving trajectory of the touch movement; when the touch type corresponding to the touch type is touch end, judging whether the canvas data at the end of touch is the same as the initial canvas data, and if so, clearing the signature event data.
[0009] Optionally, when the touch type corresponding to the signature event is touch start, recording the initial position data of the touch object, including: when the touch type corresponding to the signature event is touch start, determining whether there is a canvas data object in the sub-window; if not, creating a canvas data object in the sub-window, recording the initial canvas data and recording the canvas label position data.
[0010] Optionally, when the touch type corresponding to the signature event is touch movement, the trajectory coordinates of the movement trajectory on the canvas tag are recorded according to the position data of the movement trajectory of the touch movement, including: when the touch type corresponding to the signature event is touch movement, determining whether the canvas data object exists; if the canvas data object exists, recording the position data of each position in the movement trajectory of the touch movement; comparing each position data in the movement trajectory with the canvas tag position data to obtain the coordinate position offset of each position data in the movement trajectory; and recording the trajectory coordinates of the movement trajectory on the canvas tag according to the coordinate position offset of each position data.
[0011] Optionally, in response to a signature backtracing request of a user, playing a signature event backtracing video corresponding to the signature backtracing request includes: in response to the signature backtracing request of the user, obtaining a target backtracing code and a target timestamp in the signature backtracing request; determining a corresponding target signature event according to the target backtracing code and the target timestamp; extracting a target signature event backtracing video corresponding to the target signature event from multiple signature event backtracing videos, and playing the target signature event backtracing video.
[0012] Optionally, the method also includes: when the child window collects corresponding signature event data through the plug-in corresponding to the child window, the child window sends blank data to the parent window; when the parent window collects user operation data through the plug-in corresponding to the parent window, the parent window sends blank data to the child window.
[0013] On the other hand, a signature backtracking device based on iframe is provided, and the device includes: an adding module, which is used to add corresponding plug-ins to a parent window and a child window respectively, wherein the child window is embedded in the parent window through an iframe; a generating module, which is used for the child window to receive the backtracking code and timestamp sent by the parent window and generate a child backtracking code after the parent window and the child window have completed loading the corresponding plug-ins; a collecting module, which is used for the plug-in corresponding to the child window to determine that the touch event in the child window is a signature event, and to collect signature event data corresponding to the signature event, wherein the signature event data is associated with the child backtracking code; a sending module, which is used for the plug-in corresponding to the child window to send the signature event data in the child window to a backend, so that the backend can generate a corresponding signature event backtracking video according to the received signature event data; and a backtracking module, which is used to play the signature event backtracking video in response to a signature backtracking request of a user.
[0014] On the other hand, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: adding corresponding plug-ins to a parent window and a child window respectively, wherein the child window is embedded in the parent window via an iframe; when the parent window and the child window have completed loading the corresponding plug-ins, the child window receives a backtracking code and a timestamp sent by the parent window, and generates a child backtracking code; the plug-in corresponding to the child window determines that a touch event in the child window is a signature event, and collects signature event data corresponding to the signature event, wherein the signature event data is associated with the child backtracking code; the plug-in corresponding to the child window sends the signature event data in the child window to a backend, so that the backend generates a corresponding signature event backtracking video according to the received signature event data; and in response to a signature backtracking request from a user, playing the signature event backtracking video corresponding to the signature backtracking request.
[0015] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: corresponding plug-ins are added to a parent window and a child window respectively, wherein the child window is embedded in the parent window through an iframe; when the parent window and the child window have completed loading the corresponding plug-ins, the child window receives the backtrace code and timestamp sent by the parent window, and generates a child backtrace code; the plug-in corresponding to the child window determines that the touch event in the child window is a signature event, and collects signature event data corresponding to the signature event, wherein the signature event data is associated with the child backtrace code; the plug-in corresponding to the child window sends the signature event data in the child window to a backend, so that the backend generates a corresponding signature event backtrace video according to the received signature event data; and in response to a signature backtrace request from a user, the signature event backtrace video corresponding to the signature backtrace request is played.
[0016] The above-mentioned signature backtracking method, device, equipment and storage medium based on iframe, the method includes: adding corresponding plug-ins to the parent window and the child window respectively, wherein the child window is embedded in the parent window through iframe; when the parent window and the child window have completed loading the corresponding plug-ins, the child window receives the backtracking code and timestamp sent by the parent window, and generates a child backtracking code; the plug-in corresponding to the child window determines that the touch event in the child window is a signature event, collects the signature event data corresponding to the signature event, wherein the signature event data is associated with the child backtracking code; the plug-in corresponding to the child window sends the signature event data in the child window to the backend, so that the backend generates the corresponding signature event backtracking video according to the received signature event data; in response to the user's signature backtracking request, the signature event backtracking video corresponding to the signature backtracking request is played. In this way, the problem that the iframe page cannot be backtracked due to cross-domain can be solved, and signature backtracking can be achieved with minimal intrusion on third-party pages. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of a signature backtracking method based on iframe in one embodiment;
[0018] Figure 2 A schematic diagram of a parent-child window communication process of an iframe-based signature backtracking method in an embodiment;
[0019] Figure 3 It is a schematic diagram of the signature event data collection process of the signature backtracking method based on iframe in one embodiment;
[0020] Figure 4 A schematic diagram of a front-end iframe backtracking process of an iframe-based signature backtracking method in one embodiment;
[0021] Figure 5 It is a structural block diagram of a signature backtracking device based on iframe in one embodiment;
[0022] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like throughout the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as including but not limited to.
[0025] It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.
[0026] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps, and do not specifically refer to the order or sequence, nor are they used to limit the present application. They are only for the convenience of describing the method of the present application, and cannot be understood as indicating the order of the steps. 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 this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.
[0027] In one embodiment, Figure 1 As shown, a signature backtracking method based on iframe is provided, comprising the following steps:
[0028] S101: adding corresponding plug-ins to a parent window and a child window respectively, wherein the child window is embedded in the parent window via an iframe.
[0029] Here, iframe is an inline frame that can embed content from other sources (such as web applications, advertisements, or web analysis tools, etc.) into the host web page; a parent window can include multiple independent child windows; and the plug-in is used to collect traceback data.
[0030] Specifically, the child window is embedded in the parent window through an iframe. The child window can be used for user signature. The plug-in of the child window collects data when the user signs in the child window. The parent window can be used to execute sales activities. The plug-in of the parent window collects data when the user performs sales-related operations in the parent window.
[0031] S102: After the parent window and the child window have finished loading corresponding plug-ins, the child window receives the backtracking code and timestamp sent by the parent window, and generates a child backtracking code.
[0032] Here, the timestamp may be the time when the parent window sends the backtracking code, and the child backtracking code is composed of the backtracking code sent by the parent window and the timestamp.
[0033] Specifically, after the parent window loads the plug-in, it initiates a request to generate a backtracking code. After generating the backtracking code, the parent window sends the backtracking code and timestamp to the child window. The child window receives the backtracking code and timestamp sent by the parent window and combines the backtracking code and timestamp into a child backtracking code.
[0034] In one embodiment, after the parent window and the child window have completed loading the corresponding plug-ins, the child window receives the backtrace code sent by the parent window, records the timestamp of receiving the backtrace code, and combines the backtrace code and the timestamp to form a child backtrace code.
[0035] S103: The plug-in corresponding to the sub-window determines that the touch event in the sub-window is a signature event, and collects signature event data corresponding to the signature event, wherein the signature event data is associated with the sub-backtracking code.
[0036] Here, the sub-window is bound to the sub-traceback code when collecting signature event data; the touch event can be a mouse touch or a finger touch.
[0037] Specifically, the plug-in corresponding to the sub-window monitors the touch event in the sub-window, determines whether the target document object model element of the touch event is a canvas tag with preset attributes, and if so, determines that the touch event in the sub-window is a signature event.
[0038] Among them, DOM (document object model) provides an access model for the entire document, treating the document as a tree structure, where each node represents an element, attribute or text in the document, etc., wherein the document can be a web page, and user-defined tags and attributes can be used to identify the structural elements of the document. For example, a canvas tag with an isee_sign attribute can be customized to represent a signature event. Exemplarily, the plug-in corresponding to the subwindow monitors the touch event of the mouse or finger in the subwindow in the subwindow, and determines whether the DOM element of the target is a canvas tag with an isee_sign attribute. If so, it indicates that the corresponding touch event is a signature event.
[0039] S104: The plug-in corresponding to the sub-window sends the signature event data in the sub-window to the backend, so that the backend generates a corresponding signature event backtracking video according to the received signature event data.
[0040] Here, the backend obtains the signature event data corresponding to a signature event by filtering out the sub-backtracking codes with the same timestamp, arranges the backtracking video according to the operation time sequence of the signature event data, and generates the signature event backtracking video.
[0041] S105: In response to the user's signature backtracking request, play the signature event backtracking video corresponding to the signature backtracking request.
[0042] In one embodiment, when the backtracking system simulates playback, the backtracking system includes parent window content backtracking and child window content backtracking, and modifies the iframe part content link (i.e., the child window part) in the backtracked video to the signature event backtracking video data address to implement the operation of backtracking the child window content.
[0043] It should be noted that this application can implement same-domain and cross-domain iframe window backtracking and implement backtracking of the user signing process by introducing plug-ins in the parent and child windows at the same time.
[0044] In some specific implementations, after the parent window and the child window have completed loading the corresponding plug-ins, the child window receives the backtracking code and timestamp sent by the parent window and generates a child backtracking code, including:
[0045] After the parent window has loaded the plug-in corresponding to the parent window, the backtracking code is generated;
[0046] Determine whether the sub-window has completed loading the plug-in corresponding to the sub-window;
[0047] If the child window has completed loading the plug-in corresponding to the child window, the parent window sends the backtracking code and the timestamp to the child window, and the child window combines the backtracking code and the timestamp as a child backtracking code;
[0048] If the child window has not finished loading the plug-in corresponding to the child window, the child window sends a request for obtaining to the parent window after the loading is completed, and the parent window sends the backtrace and the timestamp code to the child window.
[0049] Here, the messages between the parent window and the child window can be transmitted through the postMessage function. The child window cannot receive the messages sent by the parent window before the plug-in is loaded.
[0050] Specifically, after the parent window backtracking code is generated, it is determined whether the child window plug-in has been loaded. If it has been loaded, the parent window sends the backtracking code and timestamp to the child window through postMessage. If it has not been loaded, after the child window is loaded, it is detected that the child window has not received the backtracking code and timestamp, and the child window sends a request to obtain the backtracking code to the parent window through postMessage, and the parent window sends the backtracking code and timestamp to the child window through postMessage.
[0051] In one embodiment, Figure 2 FIG. 1 is a schematic diagram of the parent-child window communication process in an embodiment of the present invention. Figure 2 As shown, the parent-child window communication process includes: S201 the parent window starts; S202 the parent window generates a backtracking code; S203 determines whether the child window plug-in has been loaded; if so, execute S204 to receive the backtracking code and timestamp; if not, execute S205 the child window plug-in is loaded; S206 obtains the backtracking code from the parent window; S207 the parent window monitors messages; S208 the child window sends data; S209 the parent window ends.
[0052] In this way, by generating a sub-backtracking code in the sub-window, the data collected by the sub-window can be independent of the parent window.
[0053] In some specific implementations, the collecting the signature event data corresponding to the signature event includes:
[0054] The plug-in corresponding to the sub-window determines the touch type corresponding to the signature event by monitoring the touch event in the sub-window;
[0055] According to the touch type corresponding to the signature event, collecting signature event data corresponding to the signature event, wherein the touch type includes touch start, touch move, and touch end;
[0056] When the touch type corresponding to the signature event is touch start, recording initial position data of the touch object;
[0057] When the touch type corresponding to the signature event is touch movement, recording the track coordinates of the movement track on the canvas tag according to the position data of the movement track of the touch movement;
[0058] When the touch type corresponding to the touch type is touch end, it is determined whether the canvas data at the touch end is the same as the initial canvas data, and if so, the signature event data is cleared.
[0059] Here, the touch type includes touch start, touch move, and touch end. The touch start may be mousestart or touchstart, the touch move may be mousemove or touchmove, and the touch end may be mouseend or touchend.
[0060] Specifically, assuming that the user signs by touching the subwindow, when the subwindow plug-in detects that the finger touches the canvas of the subwindow, it confirms that the touch type is touchstart and records the initial position data of the touched object; when the subwindow plug-in detects that the finger moves in the canvas of the subwindow, it confirms that the touch type is touchmove and records the signature handwriting; when the subwindow plug-in detects that the finger leaves the canvas of the subwindow, it confirms that the touch type is touchend and determines whether the canvas data at the end of the touch is the same as the initial canvas data. If so, the data is cleared.
[0061] For example, the setTimeout microtask can be set to detect whether the canvas content is consistent with the initial canvas data after the finger leaves the canvas within a preset time after the finger leaves the canvas. If they are consistent, it indicates that a canvas clearing operation is performed, and the canvas clearing operation includes clearing data and clearing drawOptions object data.
[0062] In this way, the backtracking solution of collecting user touch trajectory data and simulating restoration makes the collected data smaller, reduces the pressure on data storage, and the overall backtracking effect is closer to the user's actual operation.
[0063] In some specific implementations, when the touch type corresponding to the signature event is touch start, recording the initial position data of the touch object includes:
[0064] When the touch type corresponding to the signature event is touch start, determining whether there is a canvas data object in the sub-window;
[0065] If it does not exist, a canvas data object is created in the sub-window, and the initial canvas data and canvas label position data are recorded.
[0066] Here, the canvas tag position data is used to locate the position of the canvas tag in the sub-window, and the initial position data of the touch object is used to locate the position of the touch object (such as a mouse or finger) in the sub-window. The initial offset can be obtained through the initial position data of the touch object and the canvas tag position data.
[0067] Specifically, when the plug-in detects that the touch type of the touch event is touch start, it determines whether it is the first touch start by detecting whether there is a canvas data object in the subwindow. If there is no canvas data object, the touch start is the first touch start of the current signature event. At this time, a canvas data object is created, and the initial canvas data and canvas label position data are recorded, and the initial position data of the current touch object is recorded; if there is a canvas data object, the touch start is a normal touch start, and the initial position data of the touch object is recorded.
[0068] In some specific implementations, when the touch type corresponding to the signature event is touch movement, recording the track coordinates of the movement track on the canvas tag according to the position data of the movement track of the touch movement includes:
[0069] When the touch type corresponding to the signature event is touch movement, determining whether the canvas data object exists;
[0070] If the canvas data object exists, recording the position data of each position in the movement track of the touch movement;
[0071] Compare each position data in the movement trajectory with the canvas tag position data to obtain a coordinate position offset of each position data in the movement trajectory;
[0072] According to the coordinate position offset of each position data, the track coordinates of the moving track on the canvas tag are recorded.
[0073] Here, by setting a preset time, the position data of the touch object is acquired at fixed intervals to obtain the position data of the moving track; the position data is used to locate the position of the touch object in the sub-window.
[0074] Specifically, assuming that the touch event is a user touching the mouse, the position coordinates of the mouse in the sub-window are obtained at regular intervals, and the position coordinate data of the mouse movement trajectory in the sub-window and the canvas label position coordinate data in the sub-window are compared to obtain the coordinate position offset, thereby obtaining the position in the movement trajectory on the canvas label.
[0075] In this way, the trace information of the signature operation on the canvas tag can be obtained, thereby realizing signature backtracking.
[0076] In one embodiment, Figure 3 FIG. 1 is a schematic diagram of a signature event data collection process in an embodiment of the present invention. Figure 3As shown, the signature event data collection process includes: S301 mouse operation; S302 obtaining mouse and DOM coordinate information; S303 determining whether the DOM is a signature canvas (i.e. determining whether the touch event is a signature event); if not, executing S304 to collect mouse information data according to the ordinary mouse trajectory; if so, executing S305 to calculate the initial offset according to the mouse coordinate position and the DOM position (i.e. the canvas tag position data); S306 determining the mouse event; if it is the start of a touch, executing S307 to determine whether a drawOption object (i.e. the canvas data object) already exists, and if not, creating a drawOption object; if so, recording the mouse start coordinates of the new stroke trajectory (i.e. the initial position data of the touch object); if it is a touch move, executing S308 to obtain the coordinates and initial offset of the mouse movement, and calculating the real trajectory information; if the touch ends, executing S309 to determine whether to clear the content according to whether the canvas data is the same as the initial data (i.e. the initial canvas data); S310 sending the trajectory data to the back end.
[0077] In some specific implementations, in response to a signature backtracking request from a user, playing a signature event backtracking video corresponding to the signature backtracking request includes:
[0078] In response to a signature backtracking request from a user, obtaining a target backtracking code and a target timestamp in the signature backtracking request;
[0079] Determine a corresponding target signature event according to the target backtracking code and the target timestamp;
[0080] A target signature event backtracking video corresponding to the target signature event is extracted from a plurality of signature event backtracking videos, and the target signature event backtracking video is played.
[0081] Specifically, the user selects a signature event that needs to be traced back on the terminal device and generates a signature traceback request. The front end responds to the signature traceback request, obtains the target traceback code and target timestamp in the signature traceback request, determines the corresponding target signature event according to the target traceback code and target timestamp, matches the target signature event video from the traceback videos of multiple signature events, and plays it.
[0082] In some embodiments, the method further comprises:
[0083] When the child window collects corresponding signature event data through the plug-in corresponding to the child window, the child window sends blank data to the parent window;
[0084] When the parent window collects user operation data through the plug-in corresponding to the parent window, the parent window sends blank data to the child window.
[0085] The user operation data may be click, slide and other operation data.
[0086] Specifically, when the child window is collecting signature event data, the parent window is in an idle state and does not perform any operation. At this time, the child window sends blank data to the parent window; when the parent window is collecting user operation data, the child window is in an idle state and does not perform any operation. At this time, the parent window sends blank data to the child window.
[0087] In this way, when operating independently through the parent and child windows, each sends blank data to the other, so that the operation time can be kept consistent.
[0088] In one embodiment, Figure 4 FIG. 1 is a schematic diagram of the front-end iframe backtracking process in an embodiment of the present invention. Figure 4 As shown, the front-end iframe backtracking process includes: S401 starts collection; S402 generates a backtracking code; S403 whether the iframe is created; if not, execute S404 to determine if the dynamic iframe is created successfully; S405 initiates communication with the parent window, and the parent window tells the child window the backtracking code; if not, execute S406 to initiate communication with the iframe, and the parent window tells the child window the backtracking code; S407 the iframe starts collection; S408 ends collection.
[0089] It should be understood that although Figure 1-Figure 4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-Figure 4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0090] In one embodiment, Figure 5As shown, a signature backtracking device based on iframe is provided, and the device includes: an adding module, a generating module, a collecting module, a sending module and a backtracking module; wherein the adding module is used to add corresponding plug-ins to the parent window and the child window respectively, wherein the child window is embedded in the parent window through the iframe; the generating module is used to receive the backtracking code and timestamp sent by the parent window and generate a child backtracking code after the parent window and the child window have loaded the corresponding plug-ins; the collecting module is used for the plug-in corresponding to the child window to determine that the touch event in the child window is a signature event, and collect the signature event data corresponding to the signature event, wherein the signature event data is associated with the child backtracking code; the sending module is used for the plug-in corresponding to the child window to send the signature event data in the child window to the backend, so that the backend generates the corresponding signature event backtracking video according to the received signature event data; the backtracking module is used to play the signature event backtracking video in response to the signature backtracking request of the user.
[0091] As a preferred implementation manner, in an embodiment of the present application, the generation module is specifically used to: generate the backtrace code after the parent window has completed loading the plug-in corresponding to the parent window; determine whether the child window has completed loading the plug-in corresponding to the child window; if the child window has completed loading the plug-in corresponding to the child window, the parent window sends the backtrace code and the timestamp to the child window, and the child window combines the backtrace code and the timestamp as a child backtrace code; if the child window has not completed loading the plug-in corresponding to the child window, the child window sends a get request to the parent window after loading is completed, and the parent window sends the backtrace and timestamp codes to the child window.
[0092] As a preferred implementation manner, in an embodiment of the present application, the acquisition module is specifically used for: the plug-in corresponding to the sub-window determines the touch type corresponding to the signature event by monitoring the touch events in the sub-window; according to the touch type corresponding to the signature event, the signature event data corresponding to the signature event is acquired, wherein the touch types include touch start, touch move, and touch end; when the touch type corresponding to the signature event is touch start, the initial position data of the touch object is recorded; when the touch type corresponding to the signature event is touch move, according to the position data of the moving trajectory of the touch move, the trajectory coordinates of the moving trajectory on the canvas label are recorded; when the touch type corresponding to the touch type is touch end, it is determined whether the canvas data at the end of the touch is the same as the initial canvas data, and if so, the signature event data is cleared.
[0093] As a preferred implementation manner, in an embodiment of the present application, the acquisition module is specifically used to: when the touch type corresponding to the signature event is touch start, determine whether there is a canvas data object in the sub-window; if not, create a canvas data object in the sub-window, record the initial canvas data and record the canvas label position data.
[0094] As a preferred implementation manner, in an embodiment of the present application, the acquisition module is specifically used to: when the touch type corresponding to the signature event is touch movement, determine whether the canvas data object exists; if the canvas data object exists, record the position data of each position in the moving trajectory of the touch movement; compare each position data in the moving trajectory with the canvas label position data to obtain the coordinate position offset of each position data in the moving trajectory; and record the trajectory coordinates of the moving trajectory on the canvas label according to the coordinate position offset of each position data.
[0095] As a preferred implementation manner, in an embodiment of the present application, the acquisition module is specifically used to: respond to a user's signature backtracking request, obtain a target backtracking code and a target timestamp in the signature backtracking request; determine a corresponding target signature event based on the target backtracking code and the target timestamp; extract a target signature event backtracking video corresponding to the target signature event from multiple signature event backtracking videos, and play the target signature event backtracking video.
[0096] As a preferred implementation manner, in an embodiment of the present application, the device also includes a synchronization module, which is specifically used for when the child window collects corresponding signature event data through the plug-in corresponding to the child window, the child window sends blank data to the parent window; when the parent window collects user operation data through the plug-in corresponding to the parent window, the parent window sends blank data to the child window.
[0097] For the specific definition of the iframe-based signature backtracking device, please refer to the definition of the iframe-based signature backtracking method above, which will not be repeated here. Each module in the above-mentioned iframe-based signature backtracking device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0098] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a signature backtracking method based on iframe is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0099] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0100] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: S1: adding corresponding plug-ins to a parent window and a child window respectively, wherein the child window is embedded in the parent window via an iframe; S2: after the parent window and the child window have completed loading the corresponding plug-ins, the child window receives a backtracking code and a timestamp sent by the parent window, and generates a child backtracking code; S3: the plug-in corresponding to the child window determines that a touch event in the child window is a signature event, and collects signature event data corresponding to the signature event, wherein the signature event data is associated with the child backtracking code; S4: the plug-in corresponding to the child window sends the signature event data in the child window to a backend, so that the backend generates a corresponding signature event backtracking video according to the received signature event data; S5: in response to a signature backtracking request from a user, playing a signature event backtracking video corresponding to the signature backtracking request.
[0101] In one embodiment, the processor further implements the following steps when executing the computer program: after the parent window has completed loading the plug-in corresponding to the parent window, the backtrace code is generated; it is determined whether the child window has completed loading the plug-in corresponding to the child window; if the child window has completed loading the plug-in corresponding to the child window, the parent window sends the backtrace code and the timestamp to the child window, and the child window combines the backtrace code and the timestamp as a child backtrace code; if the child window has not completed loading the plug-in corresponding to the child window, the child window sends a get request to the parent window after loading is completed, and the parent window sends the backtrace and timestamp codes to the child window.
[0102] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the plug-in corresponding to the sub-window monitors the touch event in the sub-window; determines whether the document object model element of the target of the touch event is a canvas tag with preset attributes; if so, determines that the touch event in the sub-window is a signature event.
[0103] In one embodiment, the processor further implements the following steps when executing the computer program: the plug-in corresponding to the sub-window determines the touch type corresponding to the signature event by monitoring the touch event in the sub-window; according to the touch type corresponding to the signature event, the signature event data corresponding to the signature event is collected, wherein the touch types include touch start, touch move, and touch end; when the touch type corresponding to the signature event is touch start, the initial position data of the touch object is recorded; when the touch type corresponding to the signature event is touch move, the trajectory coordinates of the moving trajectory on the canvas tag are recorded according to the position data of the moving trajectory of the touch movement; when the touch type corresponding to the touch type is touch end, it is determined whether the canvas data at the end of the touch is the same as the initial canvas data, and if so, the signature event data is cleared.
[0104] In one embodiment, the processor further implements the following steps when executing the computer program: when the touch type corresponding to the signature event is touch movement, determining whether the canvas data object exists; if the canvas data object exists, recording the position data of each position in the moving trajectory of the touch movement; comparing each position data in the moving trajectory with the canvas label position data to obtain the coordinate position offset of each position data in the moving trajectory; and recording the trajectory coordinates of the moving trajectory on the canvas label according to the coordinate position offset of each position data.
[0105] In one embodiment, when the processor executes the computer program, the following steps are also implemented: in response to the user's signature backtracking request, obtaining the target backtracking code and the target timestamp in the signature backtracking request; determining the corresponding target signature event according to the target backtracking code and the target timestamp; extracting the target signature event backtracking video corresponding to the target signature event from multiple signature event backtracking videos, and playing the target signature event backtracking video.
[0106] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when the child window collects corresponding signature event data through the plug-in corresponding to the child window, the child window sends blank data to the parent window; when the parent window collects user operation data through the plug-in corresponding to the parent window, the parent window sends blank data to the child window.
[0107] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: S1: adding corresponding plug-ins to a parent window and a child window respectively, wherein the child window is embedded in the parent window via an iframe; S2: after the parent window and the child window have completed loading the corresponding plug-ins, the child window receives a backtracking code and a timestamp sent by the parent window, and generates a child backtracking code; S3: the plug-in corresponding to the child window determines that a touch event in the child window is a signature event, and collects signature event data corresponding to the signature event, wherein the signature event data is associated with the child backtracking code; S4: the plug-in corresponding to the child window sends the signature event data in the child window to a backend, so that the backend generates a corresponding signature event backtracking video according to the received signature event data; S5: in response to a signature backtracking request from a user, playing a signature event backtracking video corresponding to the signature backtracking request.
[0108] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: after the parent window has completed loading the plug-in corresponding to the parent window, the backtrace code is generated; it is determined whether the child window has completed loading the plug-in corresponding to the child window; if the child window has completed loading the plug-in corresponding to the child window, the parent window sends the backtrace code and the timestamp to the child window, and the child window combines the backtrace code and the timestamp as a child backtrace code; if the child window has not completed loading the plug-in corresponding to the child window, the child window sends a get request to the parent window after loading is completed, and the parent window sends the backtrace and timestamp codes to the child window.
[0109] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the plug-in corresponding to the sub-window determines the touch type corresponding to the signature event by monitoring the touch event in the sub-window; according to the touch type corresponding to the signature event, the signature event data corresponding to the signature event is collected, wherein the touch types include touch start, touch move, and touch end; when the touch type corresponding to the signature event is touch start, the initial position data of the touch object is recorded; when the touch type corresponding to the signature event is touch move, according to the position data of the moving trajectory of the touch move, the trajectory coordinates of the moving trajectory on the canvas tag are recorded; when the touch type corresponding to the touch type is touch end, it is determined whether the canvas data at the end of the touch is the same as the initial canvas data, and if so, the signature event data is cleared.
[0110] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the touch type corresponding to the signature event is touch start, determining whether there is a canvas data object in the sub-window; if not, creating a canvas data object in the sub-window, recording initial canvas data and recording canvas tag position data.
[0111] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the touch type corresponding to the signature event is touch movement, determining whether the canvas data object exists; if the canvas data object exists, recording the position data of each position in the moving trajectory of the touch movement; comparing each position data in the moving trajectory with the canvas label position data to obtain the coordinate position offset of each position data in the moving trajectory; and recording the trajectory coordinates of the moving trajectory on the canvas label according to the coordinate position offset of each position data.
[0112] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: in response to a signature backtracking request of a user, a target backtracking code and a target timestamp in the signature backtracking request are obtained; a corresponding target signature event is determined according to the target backtracking code and the target timestamp; a target signature event backtracking video corresponding to the target signature event is extracted from a plurality of signature event backtracking videos, and the target signature event backtracking video is played
[0113] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: when the child window collects corresponding signature event data through the plug-in corresponding to the child window, the child window sends blank data to the parent window; when the parent window collects user operation data through the plug-in corresponding to the parent window, the parent window sends blank data to the child window.
[0114] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0115] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0116] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A signature backtracking method based on iframe, It is characterized in that The method comprises: Add corresponding plug-ins to the parent window and the child window respectively, wherein the child window is embedded in the parent window via an iframe; When the parent window and the child window have finished loading the corresponding plug-ins, the child window receives the backtracking code and timestamp sent by the parent window and generates a child backtracking code; The plug-in corresponding to the sub-window determines that the touch event in the sub-window is a signature event, and collects signature event data corresponding to the signature event, wherein the signature event data is associated with the sub-backtracking code; The plug-in corresponding to the sub-window sends the signature event data in the sub-window to the back-end, so that the back-end generates a corresponding signature event back-tracing video according to the received signature event data; In response to a signature backtracking request from a user, a signature event backtracking video corresponding to the signature backtracking request is played.
2. The iframe-based signature backtracking method according to claim 1, It is characterized in that After the parent window and the child window have finished loading the corresponding plug-ins, the child window receives the backtracking code and timestamp sent by the parent window and generates a child backtracking code, including: After the parent window has loaded the plug-in corresponding to the parent window, the backtracking code is generated; Determine whether the sub-window has completed loading the plug-in corresponding to the sub-window; If the child window has completed loading the plug-in corresponding to the child window, the parent window sends the backtracking code and the timestamp to the child window, and the child window combines the backtracking code and the timestamp as a child backtracking code; If the child window has not finished loading the plug-in corresponding to the child window, the child window sends a request for obtaining to the parent window after the loading is completed, and the parent window sends the backtrace and the timestamp code to the child window.
3. The iframe-based signature backtracking method according to claim 1, It is characterized in that The collecting of signature event data corresponding to the signature event includes: The plug-in corresponding to the sub-window determines the touch type corresponding to the signature event by monitoring the touch event in the sub-window; According to the touch type corresponding to the signature event, collecting signature event data corresponding to the signature event, wherein the touch type includes touch start, touch move, and touch end; When the touch type corresponding to the signature event is touch start, recording initial position data of the touch object; When the touch type corresponding to the signature event is touch movement, recording the track coordinates of the movement track on the canvas tag according to the position data of the movement track of the touch movement; When the touch type corresponding to the touch type is touch end, it is determined whether the canvas data at the touch end is the same as the initial canvas data, and if so, the signature event data is cleared.
4. The iframe-based signature backtracking method according to claim 3, It is characterized in that When the touch type corresponding to the signature event is touch start, recording the initial position data of the touch object includes: When the touch type corresponding to the signature event is touch start, determining whether there is a canvas data object in the sub-window; If it does not exist, a canvas data object is created in the sub-window, and the initial canvas data and canvas label position data are recorded.
5. The iframe-based signature backtracking method according to claim 4, It is characterized in that When the touch type corresponding to the signature event is touch movement, recording the track coordinates of the movement track on the canvas tag according to the position data of the movement track of the touch movement includes: When the touch type corresponding to the signature event is touch movement, determining whether the canvas data object exists; If the canvas data object exists, recording the position data of each position in the movement track of the touch movement; Compare each position data in the movement trajectory with the canvas tag position data to obtain a coordinate position offset of each position data in the movement trajectory; According to the coordinate position offset of each position data, the track coordinates of the moving track on the canvas tag are recorded.
6. The iframe-based signature backtracking method according to claim 1, It is characterized in that The step of responding to a signature backtracking request from a user and playing a signature event backtracking video corresponding to the signature backtracking request includes: In response to a signature backtracking request from a user, obtaining a target backtracking code and a target timestamp in the signature backtracking request; Determine a corresponding target signature event according to the target backtracking code and the target timestamp; A target signature event backtracking video corresponding to the target signature event is extracted from a plurality of signature event backtracking videos, and the target signature event backtracking video is played.
7. The iframe-based signature backtracking method according to claim 1, It is characterized in that The method further comprises: When the child window collects corresponding signature event data through the plug-in corresponding to the child window, the child window sends blank data to the parent window; When the parent window collects user operation data through the plug-in corresponding to the parent window, the parent window sends blank data to the child window.
8. A signature backtracking device based on iframe, It is characterized in that The device comprises: an adding module, a generating module, a collecting module, a sending module and a backtracking module; wherein, The adding module is used to add corresponding plug-ins to the parent window and the child window respectively, wherein the child window is embedded in the parent window through an iframe; The generating module is used for, when the parent window and the child window have finished loading the corresponding plug-in, the child window receives the backtracking code and timestamp sent by the parent window, and generates a child backtracking code; The acquisition module is used for the plug-in corresponding to the sub-window to determine that the touch event in the sub-window is a signature event, and to acquire signature event data corresponding to the signature event, wherein the signature event data is associated with the sub-backtracking code; The sending module is used for the plug-in corresponding to the sub-window to send the signature event data in the sub-window to the back-end, so that the back-end generates the corresponding signature event back-tracing video according to the received signature event data; The backtracking module is used to respond to a signature backtracking request from a user and play a signature event backtracking video corresponding to the signature backtracking request.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
