CN111241538A - Method, device, medium and electronic equipment for protecting node object variable - Google Patents

Method, device, medium and electronic equipment for protecting node object variable Download PDF

Info

Publication number
CN111241538A
CN111241538A CN202010006701.1A CN202010006701A CN111241538A CN 111241538 A CN111241538 A CN 111241538A CN 202010006701 A CN202010006701 A CN 202010006701A CN 111241538 A CN111241538 A CN 111241538A
Authority
CN
China
Prior art keywords
variable
node
isolation
acquiring
protection
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.)
Granted
Application number
CN202010006701.1A
Other languages
Chinese (zh)
Other versions
CN111241538B (en
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.)
Douyin Vision Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010006701.1A priority Critical patent/CN111241538B/en
Publication of CN111241538A publication Critical patent/CN111241538A/en
Application granted granted Critical
Publication of CN111241538B publication Critical patent/CN111241538B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/53Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides a method, an apparatus, a medium, and an electronic device for protecting a node object variable. The method comprises the following steps: when a first node object of a first object node in an object node model tree is in an activated state, acquiring and analyzing the first node object, and acquiring a first protection variable and a corresponding first protection variable value; acquiring and analyzing a first isolation object and a corresponding first isolation snapshot, and acquiring a first isolation variable and a corresponding first isolation variable value; adjusting a first isolation variable and a corresponding first isolation variable value of the first isolation object to generate a second isolation variable and a corresponding second isolation variable value of a second isolation object; replacing a first node object of the first object node in the object node model tree with the second isolated object and placing the second isolated object in an activated state. The present disclosure effectively protects node object variables at the time of replacement.

Description

Method, device, medium and electronic equipment for protecting node object variable
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a medium, and an electronic device for protecting a node object variable.
Background
The microservice architecture is a new technology for deploying applications and services in the cloud. The microservice may run in its own program and communicate with an HTTP-type application program interface (API for short) through "lightweight devices". Service exposure can be distinguished from microservice architecture (e.g., exposing an HTTP-type API in existing systems) by the above-described features. In service publishing, many services may be restricted by internal independent processes. If any of the services requires some functionality to be added, the process must be narrowed. In the micro-service architecture, only the required functions need to be added in a specific certain service, and the architecture of the whole process is not influenced. For example, the local modules may be only a part of the project, and may also include horizontal modules (including other modules) and vertical modules (site architecture) to manage, combine, outside the project. Different modules need to be dynamically loaded during running, and the modules in different systems are integrated into one page to run.
However, due to independent development and mixed loading among modules in the microservice, modules on the line can interfere with each other.
There is a global variable in the computer program being programmed. The global variable can be created by some object function or created anywhere in the program. A global variable is a variable that can be referenced by all objects or functions of the program. It is more confusing for individual modules of the microservice to make calls.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
An object of the present disclosure is to provide a method, an apparatus, a medium, and an electronic device for protecting a node object variable, which can solve at least one of the above-mentioned technical problems. The specific scheme is as follows:
according to a specific embodiment of the present disclosure, in a first aspect, the present disclosure provides a method for protecting a node object variable, including:
when a first node object of a first object node in an object node model tree is in an activated state, acquiring and analyzing the first node object, and acquiring a first protection variable and a corresponding first protection variable value;
acquiring and analyzing a first isolation object and a corresponding first isolation snapshot, and acquiring a first isolation variable and a corresponding first isolation variable value;
adjusting a first isolation variable and a corresponding first isolation variable value of the first isolation object to generate a second isolation variable and a corresponding second isolation variable value of a second isolation object; wherein the second isolation variable comprises at least: the first protection variable, and a third of the first isolation variables other than the first protection variable;
replacing a first node object of the first object node in the object node model tree with the second isolated object and placing the second isolated object in an activated state.
According to a second aspect, the present disclosure provides an apparatus for protecting a node object variable, including:
the analysis first node object unit is used for acquiring and analyzing a first node object when the first node object of a first object node in the object node model tree is in an activated state, and acquiring a first protection variable and a corresponding first protection variable value;
the first isolation object analysis unit is used for acquiring and analyzing a first isolation object and a corresponding first isolation snapshot and acquiring a first isolation variable and a corresponding first isolation variable value;
a second isolation object generation unit, configured to adjust the first isolation variable and the corresponding first isolation variable value of the first isolation object, and generate a second isolation variable and a corresponding second isolation variable value of a second isolation object; wherein the second isolation variable comprises at least: the first protection variable, and a third of the first isolation variables other than the first protection variable;
a replace first node object unit for replacing a first node object of the first object node in the object node model tree with the second isolated object and placing the second isolated object in an activated state.
According to a third aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of protecting a node object variable according to any of the first aspects.
According to a fourth aspect thereof, the present disclosure provides an electronic device, comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of protecting a node object variable according to any of the first aspect.
Compared with the prior art, the scheme of the embodiment of the disclosure at least has the following beneficial effects:
the disclosure provides a method, an apparatus, a medium, and an electronic device for protecting a node object variable. The method comprises the following steps: when a first node object of a first object node in an object node model tree is in an activated state, acquiring and analyzing the first node object, and acquiring a first protection variable and a corresponding first protection variable value; acquiring and analyzing a first isolation object and a corresponding first isolation snapshot, and acquiring a first isolation variable and a corresponding first isolation variable value; adjusting a first isolation variable and a corresponding first isolation variable value of the first isolation object to generate a second isolation variable and a corresponding second isolation variable value of a second isolation object; wherein the second isolation variable comprises at least: the first protection variable, and a third of the first isolation variables other than the first protection variable; replacing a first node object of the first object node in the object node model tree with the second isolated object and placing the second isolated object in an activated state. The method and the device protect the change of the protection variable during replacement, effectively control the variable calling in the protection range of the isolation object, and avoid the interference on node objects of other object nodes in the object node model tree.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:
FIG. 1 illustrates a flow diagram of a method of protecting node object variables in accordance with an embodiment of the present disclosure;
FIG. 2 illustrates a block diagram of elements of an apparatus for protecting node object variables, according to an embodiment of the present disclosure;
fig. 3 shows an electronic device connection structure schematic according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Alternative embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
A first embodiment provided by the present disclosure is an embodiment of a method for protecting a node object variable.
The following describes an embodiment of the present disclosure in detail with reference to fig. 1, where fig. 1 is a flowchart of a method for protecting a node object variable according to an embodiment of the present disclosure.
Step S101, when a first node object of a first object node in the object node model tree is in an activated state, acquiring and analyzing the first node object, and acquiring a first protection variable and a corresponding first protection variable value.
The embodiment of the disclosure is applied to the object node model tree.
The object node model tree is an access model for the whole program document, the whole program document is represented by a tree structure, each object node of the tree represents a subprogram document, and the connection relation between the object nodes represents the relation of the subprogram documents. The structure of the object node model tree describes the interrelationship of the sub-program documents. The process of converting a program document into an object node model tree is called parsing. After being parsed, the program document is converted into an object node model tree, so that the processing of the program document can be realized through the operation on the object node model tree. The object node model tree not only describes the structure of the document, but also comprises the method and the attribute of the object, and the object nodes and the content of the object node model tree can be conveniently accessed, modified, added and deleted.
An object node model tree comprising: a document object model or a JavaScript object model. Wherein the document object model comprises a style sheet object model.
The Document Object Model (DOM for short) is a standard programming interface for processing extensible markup language. The method is an Application Program Interface (API) independent of a platform and a language, and can dynamically access programs and scripts and update the content, the structure and the style of www documents.
The DOM is a standard API that handles HTML and XML documents. The DOM provides an access model to the entire document as a tree structure, with each object node of the tree representing an HTML tag or text item within the tag. The DOM tree structure accurately describes the interrelationship between tags in an HTML document. The process of converting an HTML or XML document into a DOM tree is called parsing. The HTML document is converted into a DOM tree after being analyzed, so that the HTML document can be processed through the operation of the DOM tree. The DOM model not only describes the structure of the document, but also defines the behavior of the node object, and the object nodes and contents of the DOM tree can be conveniently accessed, modified, added and deleted by using the method and the attribute of the object.
The style sheet object model is the DOM generated by the style sheet. For example, the style sheet is a cascading style sheet.
Cascading Style Sheets (CSS) is a computer language used to represent file styles such as HTML (an application of standard generalized markup language) or XML (a subset of standard generalized markup language). The CSS can not only statically modify the web page, but also dynamically format elements of the web page in coordination with various scripting languages. The CSS can accurately control the typesetting of element positions in the webpage at a pixel level, supports almost all font and font styles and has the capability of editing webpage objects and model styles.
The JavaScript object model has prototype chains, and each node object can find members in the prototype through the chains.
The disclosed embodiment replaces the node object of the front end by using the characteristics of the object node model tree.
The first node object is a node object of a first object node in an object node model tree.
For example, the object node information of the DOM tree, that is, the attribute of the object node, includes: a tag name, a node type, a node content, a set of parent node objects, a set of child node objects, and a set of sibling node objects. The attributes of the DOM tree nodes give the basic content and structural information of the page.
Since modules in the micro-service require strict isolation, the embodiments of the present disclosure employ isolated objects as node objects for each object node in the object node model tree. The objects used for front-end execution, i.e., the execution information of the front-end, are included in the isolated objects. For example, the isolated object of each object node in the object node model tree is sandboxed.
In the field of computer security, a sandbox (also called a sandbox) is a security mechanism, and can provide an isolation environment for running programs. Often, the process is used as a source of uncertainty, damage, or failure to determine the intent of the process.
Sandboxes may tightly control the resources that programs can access. In sandboxes, network access, access to real systems, reading of input devices are typically prohibited or severely limited. From this perspective, sandboxes are one type of virtualization. And all changes in the sandbox do not cause any loss to the operating system.
Therefore, the sandbox is applied to the micro-service, so that the front-end objects can be effectively isolated, and mutual interference can be avoided.
The disclosed embodiments utilize sandboxes to simulate parallel threads among multiple sub-applications executing serially. And replacement of the active thread is implemented. The replacement process is similar to the process loading of the operating system, and is a process for storing the memory snapshot and loading the memory snapshot. The JavaScript language is well suited to building sandboxes. First, the JavaScript language can provide a full single-threaded operating mechanism, so that all sandboxes emulate the operating system management process of the single-core cpu. Secondly, a prototype chain is adopted, each node Object can find members on the prototype through the chain, a sandbox of a shadow-Object mode is particularly suitable for being created, a global variable is packaged into a shadow variable, and therefore an encapsulated window Object can be registered, tampered and transmitted through a module.
The first node object is in an active state, i.e. the first node object is in an active state. The replacement may occur at any time prior to execution of the first object node, but typically occurs when execution reaches the first object node.
The variables in the first node object include a first protection variable and a first replaceable variable.
The first replaceable variable is a variable that can be replaced or changed during the replacement process.
The first protection variable is a variable that cannot be replaced or changed during the replacement process, and includes: read-only variables, specified logical common variables and/or specified global variables.
Since the read-only variable value can only be read, but the value cannot be changed, the read-only variable is an inherent element in the object node model tree, and if the read-only variable is replaced or changed, an error is reported in the operation. To ensure proper operation after replacement. Therefore, read-only variables must be preserved during the replacement process. The read-only variable is not adjusted, and the node object after replacement cannot be protected. The read-only variable does not change during the activation of the node object.
The logical common variable is a variable defined in the node object and is accessible by at least one node object or at least one other isolated object in the object node model tree. The designated logical common variable is a logical common variable that cannot be replaced or changed in the replacement process due to the need to be preset. For example, the browser's access address, if replaced, will cause the page to jump to the old address.
For example, in the JavaScript language, a global variable is a "global" string that exists before a variable to qualify the variable. Also, the designated global variable is a global variable that cannot be replaced or changed in the replacement process due to the need to be preset.
The analyzing the first node object to obtain a first protection variable and a corresponding first protection variable value comprises the following steps:
and step S101-1, traversing object nodes in the first node object, and sequentially acquiring each variable and corresponding attribute information.
Since the object node model tree is a tree structure, the first node is a sub-tree of the object node model tree. Each variable exists as an object node in the first node object. Traversal means that each object node in the node object is sequentially visited once and only once along a certain search route. And acquiring the information of each object node in the access process, wherein the information of some object nodes comprises variables and corresponding attribute information. And acquiring all variables and corresponding attribute information in the first node object as a result of traversing the object nodes in the first node object.
And step S101-2, respectively judging whether the attribute information of each variable meets the protection variable condition.
The protection variable condition comprises: read-only variable conditions, specify logical common variable conditions, and/or specify global variable conditions.
And S101-3, if yes, determining the variable as the first protection variable, and acquiring the corresponding first protection variable value based on the first node object.
Since the first node object is in the active state, the first protection variable value is the current value of the first protection variable.
In the above steps S101-1 to S101-3, all the first protection variables and the corresponding first protection variable values are found from the first node object by traversing the object nodes in the first node object.
Step S102, a first isolation object and a corresponding first isolation snapshot are obtained and analyzed, and a first isolation variable and a corresponding first isolation variable value are obtained.
The variables in the first isolated object include a first isolated variable.
When the first isolation object of the first object node in the last object node model tree is in an activated state, the value of the first isolation variable is the first isolation variable value.
The current value of the first isolation variable may not be the value of the first isolation variable since the current first isolation object is not located on the first object node in the object node model tree. Therefore, the embodiments of the present disclosure employ the first isolated snapshot to save the last first isolated variable and the corresponding first isolated variable value.
A snapshot is a fully available copy of a specified set of data in flash memory, including an image of the corresponding data at some point in time (the point in time at which the copy began). The snapshot may be a copy of the data it represents or may be a replica of the data. The snapshot in embodiments of the present disclosure includes at least variables and variable values.
The first isolated snapshot, i.e., the last time the first isolated object was replaced, is a fully available copy of the pre-replacement data set for the first isolated object when the first isolated object of the first object node in the object node model tree is in an active state.
The analyzing the first isolation object and the corresponding first isolation snapshot to obtain the first isolation variable and the corresponding first isolation variable value comprises the following steps:
and S102-1, traversing object nodes in the first isolation object, and sequentially acquiring first isolation variables.
And S102-2, retrieving the first isolation snapshot respectively based on the first isolation variable, and acquiring the corresponding first isolation variable value.
The embodiment of the disclosure obtains a first isolation variable value corresponding to a first isolation variable through a first isolation snapshot.
Step S103, adjusting the first isolation variable and the corresponding first isolation variable value of the first isolation object, and generating a second isolation variable and a corresponding second isolation variable value of a second isolation object.
Wherein the second isolation variable comprises at least: the first protection variable, and a third of the first isolation variables other than the first protection variable.
That is, the first protection variable and the corresponding first protection variable value of the first node object are retained in the second isolation variable, the first replaceable variable and the corresponding first replaceable variable value are deleted, and the third isolation variable and the corresponding third isolation variable, which are included in the first isolation variable and are other than the first protection variable, are added.
That is, when there is a variable in the first isolated variable that is the same as the first protection variable, the variable is not adjusted to the second isolated object. This avoids replacement or alteration of the first protection variable.
Step S104, replacing the first node object of the first object node in the object node model tree by the second isolated object, and enabling the second isolated object to be in an activated state.
The above steps complete the replacement of the node object in the activated state.
The application of isolated objects (such as sandboxes) is essentially an alternating process of replacement and recovery. In order to recover the field after the first isolation object is executed, the embodiment of the disclosure further provides a recovery method.
Optionally, before the adjusting the first isolation variable and the corresponding first isolation variable value of the first isolation object and generating the second isolation variable and the corresponding second isolation variable value, the method further includes the following steps:
step S102-1, acquiring a corresponding first node snapshot based on the first node object.
The first node snapshot is a fully available copy of the current data set of the first node object for the first object node in the object node model tree before the first node object is replaced.
Optionally, the method further comprises the following steps:
and step S106, acquiring and analyzing the second isolation object, and acquiring the second isolation protection variable and the corresponding second isolation protection variable value.
The variables in the second isolated object include a second isolation protection variable and a second isolation replaceable variable.
The second isolated replaceable variable is a variable that can be replaced or altered during a replacement process.
The second isolation protection variable is a variable that cannot be replaced or changed during a replacement process, and includes: read-only variables, specified logical common variables and/or specified global variables.
Of course, step S106 may also obtain a second isolation snapshot corresponding to the second isolation object, analyze the second isolation snapshot to obtain a second isolation protection variable and a corresponding second isolation protection variable value.
Step S107, obtaining and analyzing the first node object and the corresponding first node snapshot, and obtaining a first node variable and a corresponding first node variable value.
The variables in the first node object include first node variables.
The method specifically comprises the following steps:
and S107-1, traversing object nodes in the first node object, and sequentially acquiring first node variables.
And S107-2, retrieving the first node snapshots respectively based on the first node variables, and acquiring the corresponding first node variable values.
Step S108, adjusting the first node variable of the first node object and the corresponding first node variable value, and generating a second node variable of the second node object and a corresponding second node variable value.
Wherein the second node variable at least comprises: the second isolation protection variable, and a third node variable of the first node variables other than the second isolation protection variable.
Step S109, replacing the second isolated object of the first object node in the object node model tree with the second node object, and enabling the second node object to be in an activated state.
The recovery process is the reverse of the replacement process described above.
The embodiment of the disclosure protects the change of the protection variable during replacement, effectively controls the variable calling in the protection range of the isolated object, and avoids the interference to the node objects of other object nodes in the object node model tree.
Corresponding to the first embodiment provided by the present disclosure, the present disclosure also provides a second embodiment, that is, an apparatus for protecting a node object variable. Since the second embodiment is basically similar to the first embodiment, the description is simple, and the relevant portions should be referred to the corresponding description of the first embodiment. The device embodiments described below are merely illustrative.
Fig. 2 illustrates an embodiment of an apparatus for protecting a node object variable according to the present disclosure. Fig. 2 is a block diagram of a unit of an apparatus for protecting a node object variable according to an embodiment of the present disclosure.
Referring to fig. 2, the present disclosure provides an apparatus for protecting a node object variable, including: the first node object unit 201 is analyzed, the first isolated object unit 202 is analyzed, and the second isolated object unit 203 is generated to replace the first node object unit 204.
An analyze first node object unit 201, configured to, when a first node object of a first object node in the object node model tree is in an activated state, obtain and analyze the first node object, and obtain a first protection variable and a corresponding first protection variable value;
a first isolated object analyzing unit 202, configured to obtain and analyze a first isolated object and a corresponding first isolated snapshot, and obtain a first isolated variable and a corresponding first isolated variable value;
a second isolated object generating unit 203, configured to adjust the first isolated variable and the corresponding first isolated variable value of the first isolated object, and generate a second isolated variable and a corresponding second isolated variable value of the second isolated object; wherein the second isolation variable comprises at least: the first protection variable, and a third of the first isolation variables other than the first protection variable;
a replace first node object unit 204 for replacing a first node object of the first object node in the object node model tree with the second isolated object and putting the second isolated object in an activated state.
Optionally, the unit 201 for analyzing the first node object includes:
the attribute information acquiring subunit is used for traversing object nodes in the first node object and sequentially acquiring each variable and corresponding attribute information;
the attribute information judging subunit is used for respectively judging whether the attribute information of each variable meets the protection variable condition;
and determining a first protection variable sub-unit, configured to determine that the variable is the first protection variable if the output result of the attribute information determining sub-unit is "yes", and obtain the corresponding first protection variable value based on the first node object.
Optionally, the protection variable condition includes: read-only variable conditions, specify logical common variable conditions, and/or specify global variable conditions.
Optionally, in the analyzing the first isolated object 202, the method includes:
the acquisition unit is used for acquiring a first isolation variable, and is used for traversing object nodes in the first isolation object and sequentially acquiring a first isolation variable;
and the obtaining first isolation variable value subunit is used for retrieving the first isolation snapshot respectively based on the first isolation variable and obtaining the corresponding first isolation variable value.
Optionally, in the analyzing the first isolated object 202, the method further includes:
and the acquiring first node snapshot subunit is used for acquiring a corresponding first node snapshot based on the first node object.
Optionally, the apparatus further comprises:
the second isolation object analysis unit is used for acquiring and analyzing the second isolation object and acquiring the second isolation protection variable and the corresponding second isolation protection variable value;
the analysis first node object unit is used for acquiring and analyzing the first node object and the corresponding first node snapshot and acquiring a first node variable and a corresponding first node variable value;
a second node object generating unit, configured to adjust a first node variable of the first node object and a corresponding first node variable value, and generate a second node variable of the second node object and a corresponding second node variable value; wherein the second node variable at least comprises: the second isolation protection variable and a third node variable except the second isolation protection variable in the first node variable;
and the second isolated object replacing unit is used for replacing a second isolated object of the first object node in the object node model tree by using the second node object and enabling the second node object to be in an activated state.
Optionally, the first protection variable includes: read-only variables, specified logical common variables and/or specified global variables.
The embodiment of the disclosure protects the change of the protection variable during replacement, effectively controls the variable calling in the protection range of the isolated object, and avoids the interference to the node objects of other object nodes in the object node model tree.
The third embodiment of the present disclosure provides an electronic device, where the electronic device is used in a method for protecting a node object variable, and the electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the one processor to cause the at least one processor to perform the method of protecting node object variables as described in the first embodiment.
The fourth embodiment provides a computer storage medium for protecting a node object variable, where the computer storage medium stores computer-executable instructions that can execute the method for protecting a node object variable as described in the first embodiment.
Referring now to FIG. 3, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage device 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A method of protecting a node object variable, comprising:
when a first node object of a first object node in an object node model tree is in an activated state, acquiring and analyzing the first node object, and acquiring a first protection variable and a corresponding first protection variable value;
acquiring and analyzing a first isolation object and a corresponding first isolation snapshot, and acquiring a first isolation variable and a corresponding first isolation variable value;
adjusting a first isolation variable and a corresponding first isolation variable value of the first isolation object to generate a second isolation variable and a corresponding second isolation variable value of a second isolation object; wherein the second isolation variable comprises at least: the first protection variable, and a third of the first isolation variables other than the first protection variable;
replacing a first node object of the first object node in the object node model tree with the second isolated object and placing the second isolated object in an activated state.
2. The method of claim 1, wherein analyzing the first node object to obtain a first protection variable and a corresponding first protection variable value comprises:
traversing object nodes in the first node object, and sequentially acquiring each variable and corresponding attribute information;
respectively judging whether the attribute information of each variable meets the protection variable condition;
if yes, determining the variable as the first protection variable, and acquiring the corresponding first protection variable value based on the first node object.
3. The method of claim 2, wherein the protection variable condition comprises: read-only variable conditions, specify logical common variable conditions, and/or specify global variable conditions.
4. The method of claim 1, wherein analyzing the first isolated object and the corresponding first isolated snapshot to obtain a first isolated variable and a corresponding first isolated variable value comprises:
traversing object nodes in the first isolation object, and sequentially acquiring first isolation variables;
and retrieving the first isolation snapshots respectively based on the first isolation variables, and acquiring the corresponding first isolation variable values.
5. The method of claim 1, further comprising, prior to said adjusting the first isolation variable and corresponding first isolation variable value of the first isolated object, generating a second isolation variable and corresponding second isolation variable value:
and acquiring a corresponding first node snapshot based on the first node object.
6. The method of claim 5, further comprising:
acquiring and analyzing the second isolation object, and acquiring the second isolation protection variable and the corresponding second isolation protection variable value;
acquiring and analyzing the first node object and the corresponding first node snapshot, and acquiring a first node variable and a corresponding first node variable value;
adjusting a first node variable of the first node object and the corresponding first node variable value to generate a second node variable of a second node object and a corresponding second node variable value; wherein the second node variable at least comprises: the second isolation protection variable and a third node variable except the second isolation protection variable in the first node variable;
replacing a second isolated object of the first object node in the object node model tree with the second node object and placing the second node object in an active state.
7. The method of any of claims 1-6, wherein the first protection variable comprises: read-only variables, specified logical common variables and/or specified global variables.
8. An apparatus for protecting a node object variable, comprising:
the analysis first node object unit is used for acquiring and analyzing a first node object when the first node object of a first object node in the object node model tree is in an activated state, and acquiring a first protection variable and a corresponding first protection variable value;
the first isolation object analysis unit is used for acquiring and analyzing a first isolation object and a corresponding first isolation snapshot and acquiring a first isolation variable and a corresponding first isolation variable value;
a second isolation object generation unit, configured to adjust the first isolation variable and the corresponding first isolation variable value of the first isolation object, and generate a second isolation variable and a corresponding second isolation variable value of a second isolation object; wherein the second isolation variable comprises at least: the first protection variable, and a third of the first isolation variables other than the first protection variable;
a replace first node object unit for replacing a first node object of the first object node in the object node model tree with the second isolated object and placing the second isolated object in an activated state.
9. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method of any one of claims 1 to 7.
CN202010006701.1A 2020-01-03 2020-01-03 Method, device, medium and electronic equipment for protecting node object variable Active CN111241538B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010006701.1A CN111241538B (en) 2020-01-03 2020-01-03 Method, device, medium and electronic equipment for protecting node object variable

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010006701.1A CN111241538B (en) 2020-01-03 2020-01-03 Method, device, medium and electronic equipment for protecting node object variable

Publications (2)

Publication Number Publication Date
CN111241538A true CN111241538A (en) 2020-06-05
CN111241538B CN111241538B (en) 2022-08-19

Family

ID=70865856

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010006701.1A Active CN111241538B (en) 2020-01-03 2020-01-03 Method, device, medium and electronic equipment for protecting node object variable

Country Status (1)

Country Link
CN (1) CN111241538B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060010419A1 (en) * 2004-07-08 2006-01-12 Microsoft Corporation Providing information to an isolated hosted object via system-created variable objects
US20120030256A1 (en) * 2010-07-30 2012-02-02 Wolfgang Pfeifer Common Modeling of Data Access and Provisioning for Search, Query, Reporting and/or Analytics
CN107025247A (en) * 2016-02-02 2017-08-08 广州市动景计算机科技有限公司 Method, equipment, browser and the electronic equipment handled web data
US20180032347A1 (en) * 2016-07-31 2018-02-01 Oracle International Corporation Container-based language runtime using a variable-sized container for an isolated method
US20190340059A1 (en) * 2018-05-02 2019-11-07 International Business Machines Corporation Isolating service issues in a microservice architecture

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060010419A1 (en) * 2004-07-08 2006-01-12 Microsoft Corporation Providing information to an isolated hosted object via system-created variable objects
US20120030256A1 (en) * 2010-07-30 2012-02-02 Wolfgang Pfeifer Common Modeling of Data Access and Provisioning for Search, Query, Reporting and/or Analytics
CN107025247A (en) * 2016-02-02 2017-08-08 广州市动景计算机科技有限公司 Method, equipment, browser and the electronic equipment handled web data
US20180032347A1 (en) * 2016-07-31 2018-02-01 Oracle International Corporation Container-based language runtime using a variable-sized container for an isolated method
US20190340059A1 (en) * 2018-05-02 2019-11-07 International Business Machines Corporation Isolating service issues in a microservice architecture

Also Published As

Publication number Publication date
CN111241538B (en) 2022-08-19

Similar Documents

Publication Publication Date Title
US10176270B2 (en) Performance of template based javascript widgets
CN111240684B (en) Cutting method and device of JS codes, medium and electronic equipment
CN111680253B (en) Page application data packet generation method and device, computer equipment and storage medium
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
US20140281863A1 (en) Enhanced mobilization of existing web sites
US9323729B2 (en) Coordinating the management of the layout and design of portal pages with the management of its associated web content
CN113760324A (en) Method and device for constructing micro front-end application
CA2944659A1 (en) Methods for transforming a server side template into a client side template and devices thereof
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
CN112487331A (en) Page generation method and device, storage medium and electronic equipment
US20150169533A1 (en) Server-less HTML Templates
CN110213105A (en) It is a kind of cross-platform micro- using creation method
CN111221626B (en) Method and device for creating sandbox system environment, medium and electronic equipment
CN113495730A (en) Resource package generation and analysis method and device
CN111191225B (en) Method, device, medium and electronic equipment for switching isolated objects
CN113127000A (en) Compiling method, device and equipment of application program assembly and storage medium
CN110442419B (en) Interface layout method and device for Android application
CN116860286A (en) Page dynamic update method, device, electronic equipment and computer readable medium
CN109815455B (en) Project file processing method and device
CN111241538B (en) Method, device, medium and electronic equipment for protecting node object variable
CN112384940A (en) Mechanism for WEB crawling of electronic business resource page
CN113138767B (en) Code language conversion method, device, electronic equipment and storage medium
CN111008178B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN114153462A (en) Client source code processing method and device, storage medium and electronic equipment
CN109725932B (en) Method and device for generating description document of application component

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
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.