CN111176692A - Data updating method and electronic equipment - Google Patents

Data updating method and electronic equipment Download PDF

Info

Publication number
CN111176692A
CN111176692A CN201911414633.6A CN201911414633A CN111176692A CN 111176692 A CN111176692 A CN 111176692A CN 201911414633 A CN201911414633 A CN 201911414633A CN 111176692 A CN111176692 A CN 111176692A
Authority
CN
China
Prior art keywords
target object
tree structure
updated
input box
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911414633.6A
Other languages
Chinese (zh)
Inventor
张冠南
张晓燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201911414633.6A priority Critical patent/CN111176692A/en
Publication of CN111176692A publication Critical patent/CN111176692A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a data updating method and electronic equipment, which are used for automatically and synchronously updating auxiliary data with different functions under the condition that a target object is updated in content. The method comprises the following steps: under the condition that the target object is updated, acquiring the updated target object; generating a first tree structure according to the updated target object; comparing the first tree structure with a second tree structure corresponding to the target object before updating to obtain an element changed after the target object is updated; and updating preset data according to the changed elements. By adopting the scheme provided by the application, under the condition that the target object is updated, a first tree structure can be generated according to the updated target object; and comparing the first tree structure with a second tree structure corresponding to the target object before updating, so as to obtain the changed elements of the target object after updating, and further updating the preset data based on the changed elements.

Description

Data updating method and electronic equipment
Technical Field
The present disclosure relates to the field of computers, and in particular, to a data updating method and an electronic device.
Background
The robot process automation technology can enable the robot to automatically process a large number of repeated and rule-based work flow tasks, so that the robot can replace a manual computer to complete the tasks, and the labor cost is saved. For example, for the extraction of e-mail data, the automatic operation of enterprise IT applications requires the automatic operation of target objects such as e-mail applications, enterprise IT applications, etc.
For example, when the target object is a computer or a mobile phone application, the auxiliary data may be function module data for "element positioning" to position an input box in the computer or the mobile phone application. The functional module data realizes input box positioning by positioning the class name corresponding to the input box.
However, when the target object is updated, for example, when the application adds a patch, a version update, or the like, in order to avoid CSS global pollution, the class names in the application code may be randomly confused, which may cause the auxiliary data for implementing the auxiliary function based on the class names to fail. Therefore, after the content of the target object is updated each time, the compiler is required to manually modify the auxiliary data according to the class name before and after the content is updated, which increases the labor cost, and the manual modification also has a certain hysteresis, so that in the process from the auxiliary data failure to the repair, the system is down due to the data failure for realizing different functions, which brings unnecessary loss to the user, and therefore, when the content of the target object is updated, how to automatically and synchronously update the auxiliary data for realizing different functions is an urgent technical problem to be solved.
Disclosure of Invention
An object of the embodiments of the present application is to provide a data updating method and an electronic device, which are used for automatically and synchronously updating auxiliary data that implement different functions when a target object has a content update.
In order to solve the technical problem, the embodiment of the application adopts the following technical scheme: a data update method, comprising:
under the condition that the target object is updated, acquiring the updated target object;
generating a first tree structure according to the updated target object;
comparing the first tree structure with a second tree structure corresponding to the target object before updating to obtain an element changed after the target object is updated;
and updating preset data according to the changed elements.
The invention has the beneficial effects that: in the case that the target object is updated, a first tree structure may be generated according to the updated target object; and comparing the first tree structure with a second tree structure corresponding to the target object before updating, so as to obtain the changed elements of the target object after updating, and further updating the preset data based on the changed elements.
In one embodiment, the method further comprises:
and under the condition that the version number of the target object is changed, determining that the target object is updated.
In one embodiment, the method further comprises:
under the condition that a positioning request for an input box of a target object is detected, positioning is carried out according to an input box positioning script;
and under the condition that prompt information of positioning failure fed back by the input box positioning script is received, determining that the target object is updated.
In one embodiment, the method further comprises:
and under the condition that the change of the size of the storage space occupied by the target object is detected, determining that the target object is updated.
In one embodiment, in a case that the target object contains an input box, the generating a first tree structure according to the updated target object includes:
extracting input box information in a target object;
and generating a first tree structure according to the input box information in the target object, wherein the sequence of each node of the first tree structure corresponds to the sequence of the input box in the target object one by one.
The beneficial effect of this embodiment lies in: and generating a first tree structure according to the input box information in the target object, wherein the sequence of each node of the first tree structure corresponds to the sequence of the input box in the target object one by one, so that the consistency of the node sequence and the input box sequence is ensured.
In an embodiment, the comparing the first tree structure with the second tree structure corresponding to the target object before updating to obtain the changed element of the target object after updating includes:
corresponding each node in the first tree structure to each node in the second tree structure one by one;
matching each node of the first tree structure with the input box information recorded in the corresponding node of the second tree structure;
determining the inconsistent node matched with the input box information;
and determining the class name of the input box which is changed after the target object is updated according to the class names of the input boxes respectively contained in the inconsistent nodes matched by the input box information.
The beneficial effect of this embodiment lies in: the input frame information of the node records of the first tree structure and the second tree structure can be matched to determine the node with inconsistent input frame information matching, and further determine the class name of the input frame which is changed after the target object is updated.
In one embodiment, one-to-one correspondence of each node in the first tree structure with each node in the second tree structure comprises:
determining path information from each node to a root node in the first tree structure and path information from each node to a root node in the second tree structure;
and determining nodes with the same path information to the root node in the first tree structure and the second tree structure as corresponding nodes.
In one embodiment, in a case that the preset data is a script for positioning an input box, updating the preset data according to the changed element includes:
acquiring a script instruction in the script;
and replacing the input box class name in the script instruction with the input box class name which is changed after the target object is updated.
The beneficial effect of this embodiment lies in: by replacing the input box class name in the script of the positioning input box with the input box class name which is changed after the target object is updated, the synchronous updating of the script of the positioning input box is realized under the condition that the target object is updated.
The present application further provides an electronic device, including:
the acquisition module is used for acquiring the updated target object under the condition that the target object is updated;
the generating module is used for generating a first tree structure according to the updated target object;
the comparison module is used for comparing the first tree structure with a second tree structure corresponding to the target object before updating so as to obtain an element which is changed after the target object is updated;
and the updating module is used for updating the preset data according to the changed elements.
In one embodiment, the electronic device further comprises:
and the first determining module is used for determining that the target object is updated when the version number of the target object is changed.
In one embodiment, the electronic device further comprises:
the positioning module is used for positioning according to the input box positioning script under the condition that a positioning request for an input box of the target object is detected;
and the second determining module is used for determining that the target object is updated under the condition of receiving prompt information of positioning failure fed back by the input box positioning script.
In one embodiment, the electronic device further comprises:
and the third determining module is used for determining that the target object is updated when the change of the size of the storage space occupied by the target object is detected.
In one embodiment, the generating module includes:
the extraction submodule is used for extracting the input box information in the target object under the condition that the target object contains the input box;
and the generation submodule is used for generating a first tree structure according to the input box information in the target object, wherein the sequence of each node of the first tree structure corresponds to the sequence of the input box in the target object one by one.
In one embodiment, the alignment module comprises:
a corresponding submodule, configured to correspond each node in the first tree structure to each node in the second tree structure one to one;
the matching submodule is used for matching each node of the first tree structure with the input box information recorded in the corresponding node of the second tree structure;
the first determining submodule is used for determining the inconsistent node matched with the input box information;
and the second determining submodule is used for determining the class name of the input box which is changed after the target object is updated according to the class names of the input boxes contained in the inconsistent nodes matched with the input box information.
In one embodiment, the corresponding sub-module is specifically configured to:
determining path information from each node to a root node in the first tree structure and path information from each node to a root node in the second tree structure;
and determining nodes with the same path information to the root node in the first tree structure and the second tree structure as corresponding nodes.
In one embodiment, an update module includes:
the obtaining submodule is used for obtaining a script instruction in the script under the condition that the preset data is the script used for positioning the input box;
and the replacing submodule is used for replacing the input box class name in the script instruction with the input box class name which is changed after the target object is updated.
The present embodiment also provides an electronic device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
under the condition that the target object is updated, acquiring the updated target object;
generating a first tree structure according to the updated target object;
comparing the first tree structure with a second tree structure corresponding to the target object before updating to obtain an element changed after the target object is updated;
and updating preset data according to the changed elements.
In one embodiment, the processor is further configured to:
and under the condition that the version number of the target object is changed, determining that the target object is updated.
In one embodiment, the processor is further configured to:
under the condition that a positioning request for an input box of a target object is detected, positioning is carried out according to an input box positioning script;
and under the condition that prompt information of positioning failure fed back by the input box positioning script is received, determining that the target object is updated.
In one embodiment, the processor is further configured to:
and under the condition that the change of the size of the storage space occupied by the target object is detected, determining that the target object is updated.
In one embodiment, the processor is further configured to:
in a case that the target object includes an input box, the generating a first tree structure according to the updated target object includes:
extracting input box information in a target object;
and generating a first tree structure according to the input box information in the target object, wherein the sequence of each node of the first tree structure corresponds to the sequence of the input box in the target object one by one.
In one embodiment, the processor is further configured to:
the comparing the first tree structure with a second tree structure corresponding to the target object before updating to obtain the changed element of the target object after updating includes:
corresponding each node in the first tree structure to each node in the second tree structure one by one;
matching each node of the first tree structure with the input box information recorded in the corresponding node of the second tree structure;
determining the inconsistent node matched with the input box information;
and determining the class name of the input box which is changed after the target object is updated according to the class names of the input boxes respectively contained in the inconsistent nodes matched by the input box information.
In one embodiment, the processor is further configured to:
one-to-one correspondence of each node in the first tree structure with each node in the second tree structure includes:
determining path information from each node to a root node in the first tree structure and path information from each node to a root node in the second tree structure;
and determining nodes with the same path information to the root node in the first tree structure and the second tree structure as corresponding nodes.
In one embodiment, the processor is further configured to:
under the condition that the preset data is a script used for positioning an input box, updating the preset data according to the changed elements, wherein the updating comprises the following steps:
acquiring a script instruction in the script;
and replacing the input box class name in the script instruction with the input box class name which is changed after the target object is updated.
Drawings
Fig. 1A is a flowchart of a data updating method according to an embodiment of the present application;
fig. 1B is a schematic structural diagram of an HR talent information entry system according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a first tree structure according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a second tree structure according to an embodiment of the present application;
FIG. 4 is a flow chart of a data updating method according to another embodiment of the present application;
fig. 5 is a block diagram of a data updating apparatus according to an embodiment of the present application.
Detailed Description
Various aspects and features of the present application are described herein with reference to the drawings.
It will be understood that various modifications may be made to the embodiments of the present application. Accordingly, the foregoing description should not be construed as limiting, but merely as exemplifications of embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the application.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with a general description of the application given above and the detailed description of the embodiments given below, serve to explain the principles of the application.
These and other characteristics of the present application will become apparent from the following description of preferred forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It should also be understood that, although the present application has been described with reference to some specific examples, a person of skill in the art shall certainly be able to achieve many other equivalent forms of application, having the characteristics as set forth in the claims and hence all coming within the field of protection defined thereby.
The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the application, which can be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the application of unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present application in virtually any appropriately detailed structure.
The specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the application.
Fig. 1A is a flowchart of a data updating method according to an embodiment of the present application. As shown in FIG. 1A, the method includes the following steps S11-S14:
in step S11, in the case where the target object is updated, the updated target object is acquired;
in step S12, a first tree structure is generated from the updated target object;
in step S13, comparing the first tree structure with a second tree structure corresponding to the target object before updating, so as to obtain an element that changes after the target object is updated;
in step S14, the preset data is updated according to the changed element.
In this embodiment, when the target object is updated, the updated target object is obtained; the target object may be various computer applications, software installed on the mobile terminal, or other executable instructions running on a server, a personal computer, or the mobile terminal. When the target object is subjected to version update, repair patch addition, and the like, the content of the target object itself is updated, for example, in order to avoid global contamination of the CSS, class names in background codes of the target object may be randomly confused, at this time, a first tree structure is generated according to the updated target object, then the first tree structure is compared with a second tree structure corresponding to the target object before update to obtain an element that is changed after the target object is updated, and preset data is updated according to the changed element, where the preset data may be auxiliary data for a robot process automation function, such as a script for batching files.
For example, the target object is an HR talent information entry system of a certain company, fig. 1B is an information entry page of the HR talent information entry system, when an HR wishes to realize automatic input and submission of information in the page, the HR needs to accurately locate a "name" input box, an "age" input box, a "graduation institution" input box, and a "work experience" input box in the page, so as to enter the information into the corresponding input boxes, and when an input box is located, the HR usually locates a script of the input box, where the script is located by a class name corresponding to each input box. Taking the script for positioning the "name" input box as an example, first, the class name "tall _ name _ input _ sfaffdfgs" of the "name" input box needs to be acquired, and then the script for positioning the "name" input box written by the class name is as follows:
< input class ═ talent _ name _ input _ sfafwfdfsgs >
When the HR talent information entry system is updated, in order to avoid CSS global pollution, random confusion may occur on the class name in the target object background code, for example, the class name of the "name" input box is changed to "talent _ name _ input _ qlfLsqFvMI", it should be noted that "sfaffdfsgs" and "qlfLsqFvMI" are attribute values of the class name, so as to avoid CSS global pollution, and when the system is updated, the attribute values may be randomly confused. It can be seen that, when the system is updated, the script that previously located the input box is invalidated, and therefore, when the HR talent information entry system is updated, a first tree structure is generated according to the updated HR talent information entry system, specifically as shown in fig. 2, in the tree structure, a node corresponding to a div tag includes two child nodes span and input, the span node is used to record the style of the input box, and the child node input having the same parent node as the child node span is used to record each input box class name.
And comparing the first tree structure with a second tree structure corresponding to the target object before updating to obtain the changed elements of the target object after updating. It is understood that the second tree structure refers to a tree structure generated when the target object is updated last time, as shown in fig. 3 in particular. Taking the comparison of the class names of the "name" input boxes as an example, the nodes of the "name" input boxes of the first tree structure and the second tree structure can be corresponded through the comparison path, and the class name of the "name" input box is determined by comparing the nodes of the "name" input boxes of the first tree structure and the second tree structure, and is changed from "tall _ name _ input _ sfafwfdfsgs" to "tall _ name _ input _ qlfvmi", so that the script for positioning the input box can be updated according to the changed class name of the "name" input box.
It is understood that, in the above example, the class name of the "name" input box is only the class name attribute value changed from "sfawfdsgs" to "qlflqsfvmi", so that only the class name attribute value may be replaced when updating the script, but in some cases, the engineer may adjust the input box style, for example, the "name" input box is modified to a "chinese name" input box, at which time, the engineer modifies the original class name "talent _ name _ input _ sffdfgs" to "talent _ Chinese name _ input _ qlfmi". In this case, all class names need to be replaced when updating the script.
The invention has the beneficial effects that: in the case that the target object is updated, a first tree structure may be generated according to the updated target object; and comparing the first tree structure with a second tree structure corresponding to the target object before updating, so as to obtain the changed elements of the target object after updating, and further updating the preset data based on the changed elements.
In one embodiment, the method may also be implemented as the steps of:
and determining that the target object is updated when the version number of the target object is changed.
In this embodiment, when determining whether the target object is updated, the version number of the target object may be obtained, and when the version number of the target object changes, it is determined that the target object is updated. For example, the initial version number of the target object is 1.0, and when the version number of the target object becomes 1.1, it is determined that the target object is updated.
In one embodiment, the method may also be implemented as steps A1-A2:
in step a1, in the case where a positioning request for an input box of a target object is detected, positioning is performed according to an input box positioning script;
in step a2, when receiving prompt information of positioning failure fed back by the input box positioning script, it is determined that the target object is updated.
Sometimes, in addition to the version update, the target object may be updated due to other situations, and in this case, the update situation of the target object cannot be determined through the change of the version number, so in this embodiment, it is determined that the target object is updated through the prompt information of the positioning failure fed back by the input box positioning script, specifically: under the condition that a positioning request for an input box of a target object is detected, positioning is carried out according to an input box positioning script; and under the condition of receiving prompt information of positioning failure fed back by the positioning script of the input frame, determining that the target object is updated.
In one embodiment, the method may also be implemented as the steps of:
and determining that the target object is updated when the change of the size of the storage space occupied by the target object is detected.
In some cases, whether the target object is updated or not cannot be determined through the change of the version number, and whether the target object is updated or not cannot be determined without receiving a positioning request of the input box of the target object. Specifically, when it is detected that the size of the storage space occupied by the target object changes, it is determined that the target object is updated.
It should be noted that the three ways of determining the target object update mentioned in the above three embodiments may be implemented in combination.
In one embodiment, in the case where the target object contains an input box, the above step S12 may be implemented as the following steps B1-B2:
in step B1, the input box information in the target object is extracted;
in step B2, a first tree structure is generated according to the input box information in the target object, wherein the order of each node of the first tree structure corresponds to the order of the input box in the target object one by one.
In the embodiment, input box information in a target object is extracted; and then generating a first tree structure according to the input box information in the target object, wherein the sequence of each node of the first tree structure corresponds to the sequence of the input box in the target object one by one.
Still taking an HR talent information entry system of a certain company as an example, html codes corresponding to the HR talent information entry system in the above example are as follows:
Figure BDA0002350872960000131
Figure BDA0002350872960000141
the process of generating the tree structure based on the html code is specifically as follows:
extracting corresponding labels and contents in the labels from the html codes, generating a tree structure based on label sequence, wherein each label corresponds to one node, and recording the contents in the labels in the nodes. Extracting "< html > </html >" tags from html codes shown in FIG. 4 as root nodes of a tree structure, extracting head tags "< head > </head >" and body tags "< body > </body >" as primary child nodes of the tree structure, extracting tags "< title > </title >", "< h1> </h1 >" and "< div > </div >" of all block-level elements in the head tags and the body tags as secondary child nodes, extracting line-level element tags "< span > </span >" and inline element tags "< input >" as tertiary child nodes, then generating a first tree structure based on the root node, the first-level child node, the second-level child node and the third-level child node, and the child node corresponding to each row-level element label is the same as the child node corresponding to the inline element, and the parent nodes of the child nodes and the parent nodes are the same. After the first tree structure is generated, the content recorded in the label corresponding to each node is added to the corresponding node for recording.
The beneficial effect of this embodiment lies in: and generating a first tree structure according to the input box information in the target object, wherein the sequence of each node of the first tree structure corresponds to the sequence of the input box in the target object one by one, so that the consistency of the node sequence and the input box sequence is ensured.
In one embodiment, as shown in FIG. 4, the above step S13 can be implemented as the following steps S41-S44:
in step S41, each node in the first tree structure is in one-to-one correspondence with each node in the second tree structure;
in step S42, each node of the first tree structure is matched with the input box information recorded in the corresponding node in the second tree structure;
in step S43, it is determined that the input box information matches a node that is inconsistent;
in step S44, the class name of the input box whose target object has changed after update is determined based on the class names of the input boxes included in the nodes whose input box information matches each other.
In this embodiment, each node in the first tree structure corresponds to each node in the second tree structure one to one; specifically, the correspondence relationship of the nodes may be determined based on each node in the first tree structure and the second tree structure and a path to the root node. Then matching each node of the first tree structure with the input box information recorded in the corresponding node of the second tree structure; determining the inconsistent node matching of the input box information, specifically, comparing the label contents recorded in the node; for example, in fig. 2 and 3, the node in the rectangular frame is the node corresponding to the "name" input frame, and it can be seen by comparison that the content recorded in the node "input" corresponding to the class name of the "name" input frame in fig. 2 and the content recorded in the node "input" corresponding to the class name of the "name" input frame in fig. 3 do not match with each other, and therefore, it can be determined that the class name of the name "input frame is changed from" talent _ name _ input _ sfafwfdfsgs "to" talent _ name _ input _ qlfqfvmi ".
The beneficial effect of this embodiment lies in: the input frame information of the node records of the first tree structure and the second tree structure can be matched to determine the node with inconsistent input frame information matching, and further determine the class name of the input frame which is changed after the target object is updated.
In one embodiment, the above step S61 can be implemented as the following steps C1-C2:
in step C1, determining path information from each node in the first tree structure to the root node and path information from each node in the second tree structure to the root node;
in step C2, the node in the first tree structure and the node in the second tree structure whose path information to the root node is the same is determined to be the corresponding node.
In this embodiment, path information from each node to a root node in the first tree structure and path information from each node to a root node in the second tree structure are determined; thus, the corresponding relation between the nodes in the first tree structure and the second tree structure can be established through the nodes with the same path to the root node.
It should be noted that, when the target object is the HR talent information entry system or the like in the above example, the input box style is usually not changed, that is, the content in the row-level element label "< span > </span >" is usually not changed, in other words, the content recorded in the span node is usually not changed, and therefore, the correspondence relationship between the span nodes between two tree nodes can also be determined based on the content recorded in the span node, and the correspondence relationship between the input nodes located under the same parent node as the span node in the two tree structures can also be determined based on the correspondence relationship between the span nodes. For example, in fig. 2 and 3, the content of the span node record in the rectangular frame is "name", and there is a correspondence with the input node located under the same parent node as the span node record with the content of "name".
In one embodiment, in the case where the preset data is a script for positioning an input box, the above step S14 may be implemented as the following steps D1-D2:
in step D1, acquiring a script instruction in the script;
in step D2, the input box class name in the script instruction is replaced with the input box class name that has changed after the target object is updated.
In the embodiment, under the condition that the preset data is the script for positioning the input box, a script instruction in the script is obtained; and replacing the input box class name in the script instruction with the input box class name which is changed after the target object is updated.
For example, the preset data is a script for positioning a "name" input box, and the script instructions in the script are:
< input class ═ talent _ name _ input _ sfaffddgs "placeholder ═ please input chinese name"/>.
When the target object is updated, the class name of the "name" input box is changed from "talent _ name _ input _ sfafdfsgs" to "talent _ name _ input _ qlfqfvmi", and at this time, the input box class name in the script command is replaced with the input box class name that has been changed after the target object is updated. The modified script instruction is:
< input class ═ talent _ name _ input _ qlfLsqFvMI "placeholder ═ please enter chinese name"/>.
The beneficial effect of this embodiment lies in: by replacing the input box class name in the script of the positioning input box with the input box class name which is changed after the target object is updated, the synchronous updating of the script of the positioning input box is realized under the condition that the target object is updated.
Fig. 5 is a block diagram of an electronic device according to an embodiment of the present application. As shown in fig. 5, the electronic apparatus includes:
an obtaining module 51, configured to obtain, when the target object is updated, the updated target object;
a generating module 52, configured to generate a first tree structure according to the updated target object;
a comparing module 53, configured to compare the first tree structure with a second tree structure corresponding to the target object before updating, so as to obtain an element that changes after the target object is updated;
and an updating module 54, configured to update the preset data according to the changed element.
In one embodiment, the electronic device further comprises:
and the first determining module is used for determining that the target object is updated under the condition that the version number of the target object is changed.
In one embodiment, the electronic device further comprises:
the positioning module is used for positioning according to the input box positioning script under the condition that a positioning request for an input box of the target object is detected;
and the second determining module is used for determining that the target object is updated under the condition of receiving prompt information of positioning failure fed back by the input box positioning script.
In one embodiment, the electronic device further comprises:
and the third determining module is used for determining that the target object is updated under the condition that the change of the size of the storage space occupied by the target object is detected.
In one embodiment, a generation module includes:
the extraction submodule is used for extracting the input box information in the target object under the condition that the target object contains the input box;
and the generation submodule is used for generating a first tree structure according to the input box information in the target object, wherein the sequence of each node of the first tree structure corresponds to the sequence of the input box in the target object one by one.
In one embodiment, the alignment module comprises:
the corresponding sub-modules are used for corresponding each node in the first tree structure to each node in the second tree structure one by one;
the matching submodule is used for matching each node of the first tree structure with the input frame information recorded in the corresponding node of the second tree structure;
the first determining submodule is used for determining the inconsistent node matched with the input box information;
and the second determining submodule is used for determining the class name of the input box which is changed after the target object is updated according to the class names of the input boxes contained in the inconsistent nodes matched with the input box information.
In one embodiment, the corresponding sub-module is specifically configured to:
determining path information from each node to a root node in the first tree structure and path information from each node to the root node in the second tree structure;
and determining nodes with the same path information to the root node in the first tree structure and the second tree structure as corresponding nodes.
In one embodiment, an update module includes:
the obtaining submodule is used for obtaining a script instruction in the script under the condition that the preset data is the script for positioning the input box;
and the replacing submodule is used for replacing the input box class name in the script instruction with the input box class name which is changed after the target object is updated.
The present embodiment also provides an electronic device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
under the condition that the target object is updated, acquiring the updated target object;
generating a first tree structure according to the updated target object;
comparing the first tree structure with a second tree structure corresponding to the target object before updating to obtain an element changed after the target object is updated;
and updating the preset data according to the changed elements.
In one embodiment, the processor is further configured to:
and determining that the target object is updated when the version number of the target object is changed.
In one embodiment, the processor is further configured to:
under the condition that a positioning request for an input box of a target object is detected, positioning is carried out according to an input box positioning script;
and under the condition of receiving prompt information of positioning failure fed back by the positioning script of the input frame, determining that the target object is updated.
In one embodiment, the processor is further configured to:
and determining that the target object is updated when the change of the size of the storage space occupied by the target object is detected.
In one embodiment, the processor is further configured to:
generating a first tree structure from the updated target object when the target object contains the input box, including:
extracting input box information in a target object;
and generating a first tree structure according to the input box information in the target object, wherein the sequence of each node of the first tree structure corresponds to the sequence of the input box in the target object one by one.
In one embodiment, the processor is further configured to:
comparing the first tree structure with a second tree structure corresponding to the target object before updating to obtain the changed element of the target object after updating, including:
each node in the first tree structure corresponds to each node in the second tree structure one by one;
matching each node of the first tree structure with the input box information recorded in the corresponding node of the second tree structure;
determining the inconsistent node matched with the input box information;
and determining the class name of the input box which is changed after the target object is updated according to the class names of the input boxes respectively contained in the inconsistent nodes matched by the input box information.
In one embodiment, the processor is further configured to:
one-to-one correspondence of each node in the first tree structure with each node in the second tree structure includes:
determining path information from each node to a root node in the first tree structure and path information from each node to the root node in the second tree structure;
and determining nodes with the same path information to the root node in the first tree structure and the second tree structure as corresponding nodes.
In one embodiment, the processor is further configured to:
under the condition that the preset data is a script used for positioning the input box, updating the preset data according to the changed elements, wherein the updating comprises the following steps:
acquiring a script instruction in a script;
and replacing the input box class name in the script instruction with the input box class name which is changed after the target object is updated.
The above embodiments are only exemplary embodiments of the present application, and are not intended to limit the present application, and the protection scope of the present application is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present application and such modifications and equivalents should also be considered to be within the scope of the present application.

Claims (10)

1. A method for updating data, comprising:
under the condition that the target object is updated, acquiring the updated target object;
generating a first tree structure according to the updated target object;
comparing the first tree structure with a second tree structure corresponding to the target object before updating to obtain an element changed after the target object is updated;
and updating preset data according to the changed elements.
2. The method of claim 1, wherein the method further comprises:
and under the condition that the version number of the target object is changed, determining that the target object is updated.
3. The method of claim 1, wherein the method further comprises:
under the condition that a positioning request for an input box of a target object is detected, positioning is carried out according to an input box positioning script;
and under the condition that prompt information of positioning failure fed back by the input box positioning script is received, determining that the target object is updated.
4. The method of claim 1, wherein the method further comprises:
and under the condition that the change of the size of the storage space occupied by the target object is detected, determining that the target object is updated.
5. The method of claim 1, wherein in the case that the target object contains an input box, the generating a first tree structure from the updated target object comprises:
extracting input box information in a target object;
and generating a first tree structure according to the input box information in the target object, wherein the sequence of each node of the first tree structure corresponds to the sequence of the input box in the target object one by one.
6. The method according to any one of claims 1 to 5, wherein comparing the first tree structure with a second tree structure corresponding to the target object before updating to obtain the changed element of the target object after updating comprises:
corresponding each node in the first tree structure to each node in the second tree structure one by one;
matching each node of the first tree structure with the input box information recorded in the corresponding node of the second tree structure;
determining the inconsistent node matched with the input box information;
and determining the class name of the input box which is changed after the target object is updated according to the class names of the input boxes respectively contained in the inconsistent nodes matched by the input box information.
7. The method of claim 6, wherein one-to-one correspondence of each node in the first tree structure with each node in the second tree structure comprises:
determining path information from each node to a root node in the first tree structure and path information from each node to a root node in the second tree structure;
and determining nodes with the same path information to the root node in the first tree structure and the second tree structure as corresponding nodes.
8. The method according to any one of claims 1 to 7, wherein in the case that the preset data is a script for positioning an input box, updating the preset data according to the changed element comprises:
acquiring a script instruction in the script;
and replacing the input box class name in the script instruction with the input box class name which is changed after the target object is updated.
9. An electronic device, comprising:
the acquisition module is used for acquiring the updated target object under the condition that the target object is updated;
the generating module is used for generating a first tree structure according to the updated target object;
the comparison module is used for comparing the first tree structure with a second tree structure corresponding to the target object before updating so as to obtain an element which is changed after the target object is updated;
and the updating module is used for updating the preset data according to the changed elements.
10. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
under the condition that the target object is updated, acquiring the updated target object;
generating a first tree structure according to the updated target object;
comparing the first tree structure with a second tree structure corresponding to the target object before updating to obtain an element changed after the target object is updated;
and updating preset data according to the changed elements.
CN201911414633.6A 2019-12-31 2019-12-31 Data updating method and electronic equipment Pending CN111176692A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911414633.6A CN111176692A (en) 2019-12-31 2019-12-31 Data updating method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911414633.6A CN111176692A (en) 2019-12-31 2019-12-31 Data updating method and electronic equipment

Publications (1)

Publication Number Publication Date
CN111176692A true CN111176692A (en) 2020-05-19

Family

ID=70657759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911414633.6A Pending CN111176692A (en) 2019-12-31 2019-12-31 Data updating method and electronic equipment

Country Status (1)

Country Link
CN (1) CN111176692A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112230973A (en) * 2020-11-11 2021-01-15 国网山东省电力公司 Self-adaptive cross-software-domain RPA system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108647025A (en) * 2018-05-15 2018-10-12 浙江口碑网络技术有限公司 Processing method and processing device, electronics and the storage device of DOM Document Object Model interior joint

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108647025A (en) * 2018-05-15 2018-10-12 浙江口碑网络技术有限公司 Processing method and processing device, electronics and the storage device of DOM Document Object Model interior joint

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112230973A (en) * 2020-11-11 2021-01-15 国网山东省电力公司 Self-adaptive cross-software-domain RPA system

Similar Documents

Publication Publication Date Title
CN111443912B (en) Component-based page rendering method, device, computer equipment and storage medium
US20130339787A1 (en) Systematic failure remediation
US20150278231A1 (en) System and method for customizing archive of a device driver generator tool for a user
CN111126010B (en) Freemaker template file restoration method and device, computer equipment and storage medium
CN110347984B (en) Policy page changing method and device, computer equipment and storage medium
CN111176692A (en) Data updating method and electronic equipment
CN108319466A (en) A kind of restoration methods and device of configuration information
CN110837727A (en) Document template generation method and device, terminal equipment and medium
CN109460318B (en) Import method of rollback archive collected data, computer device and computer readable storage medium
CN110716804A (en) Method and device for automatically deleting useless resources, storage medium and electronic equipment
CN108196921B (en) Document development method and device, computer equipment and storage medium
CN116185416A (en) Operator interface file generation method, device, equipment and storage medium
CN102254155B (en) accurate font activation
CN112579456B (en) Web automatic testing method and device
CN106874587B (en) Dynamic label system for IP parameterization unit combination and implementation method
WO2017072872A1 (en) Business program generation assistance system and business program generation assistance method
CN107092476B (en) Desktop layout detection method and device and mobile terminal
CN112363929A (en) System online method and device, computer equipment and storage medium
CN102567305B (en) The page of resolving in layout relevant documentation is quoted
US20150169300A1 (en) Centralized system to transform a language neutral string content into a format of a desired platform
CN112817931A (en) Method and device for generating incremental version file
CN112181486A (en) Data processing method, device and storage medium
CN103761247A (en) Processing method and device for error files
US11934800B2 (en) Generating metadata to facilitate code generation
CN110968591A (en) Query statement generation method and device, storage medium and processor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200519