CN111797351A - Page data management method and device, electronic equipment and medium - Google Patents
Page data management method and device, electronic equipment and medium Download PDFInfo
- Publication number
- CN111797351A CN111797351A CN202010610728.1A CN202010610728A CN111797351A CN 111797351 A CN111797351 A CN 111797351A CN 202010610728 A CN202010610728 A CN 202010610728A CN 111797351 A CN111797351 A CN 111797351A
- Authority
- CN
- China
- Prior art keywords
- page
- target
- operation request
- determining
- data management
- 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
Links
- 238000013523 data management Methods 0.000 title claims abstract description 69
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000004048 modification Effects 0.000 claims abstract description 101
- 238000012986 modification Methods 0.000 claims abstract description 101
- 238000013507 mapping Methods 0.000 claims abstract description 35
- 230000004044 response Effects 0.000 claims abstract description 32
- 238000005516 engineering process Methods 0.000 claims abstract description 8
- 238000012545 processing Methods 0.000 claims abstract description 7
- 238000004458 analytical method Methods 0.000 claims description 17
- 238000007781 pre-processing Methods 0.000 claims description 10
- 238000004806 packaging method and process Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 description 14
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000010276 construction Methods 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 230000004075 alteration Effects 0.000 description 2
- 235000014510 cooky Nutrition 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/425—Lexical analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
- G06F9/4451—User profiles; Roaming
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention relates to data processing and provides a page data management method, a page data management device, electronic equipment and a page data management medium. The method can determine a target project, determine all pages in the target project, acquire all configuration files corresponding to all the pages, construct an abstract syntax tree based on all the configuration files, generate an operation request based on a preset identifier when the preset identifier is detected in the abstract syntax tree, determine a current page of the target project, execute a response to the current page based on the operation request, and store a mapping relation between the operation request and a response result. The method and the device can quickly and intuitively acquire the reading source or the modification source of the current page data, and simultaneously, the data management code and the service logic code between the pages are separated, so that the whole code amount on the pages is reduced, and the maintainability and the readability of the code are improved. In addition, the invention also relates to a block chain technology, and the mapping relation can be stored in the block chain.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a page data management method and apparatus, an electronic device, and a medium.
Background
Currently, three modes of URL (uniform resource locator), H5web storage and cookie are commonly used in a front-end cross-page data transfer mode, however, the URL mode and the cookie have certain size limitation on the length of transferred data, for this reason, in a large-scale front-end project, an H5web storage mode is generally adopted for data transfer, but in an operation process of completing data transfer in an H5web storage mode, a developer cannot quickly and intuitively learn a specific page where data is newly created or modified because data management transferred between pages is not clear enough.
Therefore, how to quickly and intuitively learn the specific page newly built or modified by the page data becomes a problem which needs to be solved urgently.
Disclosure of Invention
In view of the above, it is desirable to provide a page data management method, device, electronic device and medium, which can not only quickly and intuitively obtain a reading source or a modification source of current page data, but also reduce the overall code amount on a page and increase maintainability and readability of the code.
A page data management method, comprising:
when a data management instruction is received, determining a target project according to the data management instruction;
determining all pages in the target project;
acquiring all configuration files corresponding to all pages, and constructing an abstract syntax tree based on all the configuration files;
when a preset identification is detected in the abstract syntax tree, generating an operation request based on the preset identification;
determining a current page of the target project;
and executing the response to the current page based on the operation request, and storing the mapping relation between the operation request and the response result.
According to a preferred embodiment of the present invention, the determining all pages in the target item comprises:
acquiring a target setting file corresponding to the target project;
determining a first file path from the target setting file, and acquiring an entry file based on the first file path;
acquiring an item directory from the entry file;
and extracting all page information in the item directory, and determining all pages corresponding to all the page information.
According to a preferred embodiment of the present invention, said constructing an abstract syntax tree based on said all configuration files comprises:
for each configuration file, converting the format of the configuration code of each configuration file into a preset format to obtain a target code with the preset format;
performing lexical analysis on the target code;
carrying out grammar analysis on the target code after lexical analysis to obtain a preprocessing code;
and constructing the abstract syntax tree according to the preprocessing codes.
According to a preferred embodiment of the present invention, the generating an operation request based on the preset identifier includes:
when the preset identification is detected to be a reading identification, obtaining a key value corresponding to the reading identification, wherein the key value comprises a reading source, obtaining a corresponding value of the reading source, the corresponding value comprises a first line number and a first field, packaging the reading identification, the first line number and the first field, and generating a reading operation request; and/or
When the preset identification is detected to be a modification identification, obtaining a key value corresponding to the modification identification, wherein the key value comprises a first modification object, obtaining a corresponding value of the first modification object, determining a first modification type according to the corresponding value, determining a first modification source according to the corresponding value, packaging the first modification object, the first modification type and the first modification source, and generating a modification operation request.
According to a preferred embodiment of the present invention, the performing the response to the current page based on the operation request includes:
when the operation request is the reading operation request, determining an operation page of the reading operation request, analyzing the reading operation request to obtain a second line number and a second field, determining a storage value according to the operation page and the second line number, and assigning the storage value to a position corresponding to the second field in the current page; and/or
When the operation request is the modification operation request, determining an operation page of the modification operation request, analyzing the modification operation request to obtain a second modification type, a second modification object and a second modification source, determining a storage value according to the operation page and the second modification source, determining a target value corresponding to the second modification in the current page, and processing the target value according to the storage value and the second modification type.
According to a preferred embodiment of the present invention, the determining the current page of the target item comprises:
detecting whether the abstract syntax tree contains a key identification;
when detecting that any abstract syntax tree contains the key identification, acquiring a current configuration file corresponding to the any abstract syntax tree;
and determining the page corresponding to the current configuration file as the current page.
According to the preferred embodiment of the present invention, after the mapping relationship between the operation request and the response result is saved, the page data management method further includes:
establishing an identification code of the mapping relation;
determining the abstract syntax tree of which the preset identification is detected as a target syntax tree, and acquiring a target configuration file corresponding to the target syntax tree;
determining a target page based on the target profile;
storing the corresponding relation between the identification code and the target page;
generating prompt information of the data management instruction based on the corresponding relation;
encrypting the prompt information by adopting a symmetric encryption technology to obtain a ciphertext;
and when the ciphertext is detected to be decrypted successfully, displaying the prompt message.
A page data management apparatus, the page data management apparatus comprising:
the determining unit is used for determining a target project according to a data management instruction when the data management instruction is received;
the determining unit is further configured to determine all pages in the target project;
the constructing unit is used for acquiring all configuration files corresponding to all the pages and constructing an abstract syntax tree based on all the configuration files;
the generating unit is used for generating an operation request based on a preset identifier when the preset identifier is detected in the abstract syntax tree;
the determining unit is further configured to determine a current page of the target item;
and the execution unit is used for executing the response to the current page based on the operation request and storing the mapping relation between the operation request and the response result.
According to a preferred embodiment of the present invention, the determining unit determines that all pages in the target item include:
acquiring a target setting file corresponding to the target project;
determining a first file path from the target setting file, and acquiring an entry file based on the first file path;
acquiring an item directory from the entry file;
and extracting all page information in the item directory, and determining all pages corresponding to all the page information.
According to a preferred embodiment of the present invention, the constructing unit constructs an abstract syntax tree based on all the configuration files, including:
for each configuration file, converting the format of the configuration code of each configuration file into a preset format to obtain a target code with the preset format;
performing lexical analysis on the target code;
carrying out grammar analysis on the target code after lexical analysis to obtain a preprocessing code;
and constructing the abstract syntax tree according to the preprocessing codes.
According to a preferred embodiment of the present invention, the generating, by the generating unit, the operation request based on the preset identifier includes:
when the preset identification is detected to be a reading identification, obtaining a key value corresponding to the reading identification, wherein the key value comprises a reading source, obtaining a corresponding value of the reading source, the corresponding value comprises a first line number and a first field, packaging the reading identification, the first line number and the first field, and generating a reading operation request; and/or
When the preset identification is detected to be a modification identification, obtaining a key value corresponding to the modification identification, wherein the key value comprises a first modification object, obtaining a corresponding value of the first modification object, determining a first modification type according to the corresponding value, determining a first modification source according to the corresponding value, packaging the first modification object, the first modification type and the first modification source, and generating a modification operation request.
According to a preferred embodiment of the present invention, the executing unit, based on the operation request, executing the response to the current page includes:
when the operation request is the reading operation request, determining an operation page of the reading operation request, analyzing the reading operation request to obtain a second line number and a second field, determining a storage value according to the operation page and the second line number, and assigning the storage value to a position corresponding to the second field in the current page; and/or
When the operation request is the modification operation request, determining an operation page of the modification operation request, analyzing the modification operation request to obtain a second modification type, a second modification object and a second modification source, determining a storage value according to the operation page and the second modification source, determining a target value corresponding to the second modification in the current page, and processing the target value according to the storage value and the second modification type.
According to a preferred embodiment of the present invention, the determining unit determining the current page of the target item includes:
detecting whether the abstract syntax tree contains a key identification;
when detecting that any abstract syntax tree contains the key identification, acquiring a current configuration file corresponding to the any abstract syntax tree;
and determining the page corresponding to the current configuration file as the current page.
According to the preferred embodiment of the present invention, the page data management apparatus further includes:
the establishing unit is used for establishing an identification code of the mapping relation after the mapping relation between the operation request and the response result is stored;
the determining unit is further configured to determine the abstract syntax tree in which the preset identifier is detected as a target syntax tree, and acquire a target configuration file corresponding to the target syntax tree;
the determining unit is further used for determining a target page based on the target configuration file;
the storage unit is used for storing the corresponding relation between the identification code and the target page;
the generating unit is further used for generating prompt information of the data management instruction based on the corresponding relation;
the encryption unit is used for encrypting the prompt message by adopting a symmetric encryption technology to obtain a ciphertext;
and the display unit is used for displaying the prompt message when the ciphertext is detected to be decrypted successfully.
An electronic device, the electronic device comprising:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the page data management method.
A computer-readable storage medium having stored therein at least one instruction, the at least one instruction being executable by a processor in an electronic device to implement the page data management method.
According to the technical scheme, the reading source or the modification source of the current page data can be quickly and intuitively obtained through the mapping relation, and in addition, the data management code and the service logic code between the pages are separated, so that the whole code quantity on the pages is reduced, and the maintainability and the readability of the codes are improved.
Drawings
FIG. 1 is a flow chart of a page data management method according to a preferred embodiment of the present invention.
FIG. 2 is a functional block diagram of a page data management device according to a preferred embodiment of the present invention.
FIG. 3 is a schematic structural diagram of an electronic device implementing a page data management method according to a preferred embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of a page data management method according to a preferred embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
The page data management method is applied to a smart government scene, so that the construction of a smart city is promoted. The page data management method is applied to one or more electronic devices, which are devices capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware of the electronic devices includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The electronic device may be any electronic product capable of performing human-computer interaction with a user, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an interactive Internet Protocol Television (IPTV), a smart wearable device, and the like.
The electronic device may also include a network device and/or a user device. The network device includes, but is not limited to, a single network server, a server group consisting of a plurality of network servers, or a cloud computing (cloud computing) based cloud consisting of a large number of hosts or network servers.
The network in which the electronic device is located includes, but is not limited to: the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
In at least one embodiment of the present invention, the present invention is applied to an electronic device that communicates with a plurality of data sources and an extranet server that includes a target database.
S10, when receiving the data management command, determining the target item according to the data management command.
In at least one embodiment of the present invention, the information carried by the data management instruction includes, but is not limited to: object tags, item names, etc.
In at least one embodiment of the present invention, the electronic device determining the target item according to the data management instruction comprises:
and the electronic equipment acquires a target label, extracts information corresponding to the target label from all information carried by the data management instruction as a project name, and determines the corresponding target project according to the project name.
And the target item can be accurately determined through the mapping relation between the target label and the item name.
S11, determining all pages in the target project.
In at least one embodiment of the present invention, each item has a corresponding setting file, that is, a mapping relationship between an item and a setting file is stored in a configuration library of the electronic device, and further, each setting file records a first file path and a second file path, where the first file path represents a position where an item entry file is located, and the second file path represents a position where a configuration file of all pages is located.
In at least one embodiment of the present invention, the all pages include, but are not limited to: detail pages, related pages, etc.
In at least one embodiment of the present invention, the electronic device determining all pages in the target item comprises:
acquiring a target setting file corresponding to the target project;
determining a first file path from the target setting file, and acquiring an entry file based on the first file path;
acquiring an item directory from the entry file;
and extracting all page information in the item directory, and determining all pages corresponding to all the page information.
Wherein the page information represents that different pages have different page information, and the page information may include, but is not limited to: page address, etc.
S12, acquiring all configuration files corresponding to all pages, and constructing an abstract syntax tree based on all configuration files.
In at least one embodiment of the present invention, the acquiring, by the electronic device, all the configuration files corresponding to all the pages includes:
and acquiring a second file path from the target setting file, and further acquiring all the configuration files from the second file path by the electronic equipment.
Through the implementation mode, all the configuration files can be acquired quickly.
In at least one embodiment of the invention, the electronic device building an abstract syntax tree based on all the configuration files comprises:
for each configuration file, converting the format of the configuration code of each configuration file into a preset format to obtain a target code with the preset format;
performing lexical analysis on the target code;
carrying out grammar analysis on the target code after lexical analysis to obtain a preprocessing code;
and constructing the abstract syntax tree according to the preprocessing codes.
The preset format is a format capable of generating the abstract syntax tree, and the configuration code is not limited in format by the scheme because the configuration code can be converted into a uniform preset format, and the configuration code may be in a C language format or a JAVA language format. By formatting the configuration codes, a uniform preset format can be obtained, so that the configuration codes in any format can be converted into the uniform preset format after being formatted.
Further, the lexical analysis is to cut the target code into multiple tokens and assign a number to each token. The configuration code is actually cut into multiple tokens and each token is assigned a number in sequence.
Furthermore, the grammar parsing is to combine the words into a sentence with a certain grammar, such as "program", "expression", and the like, based on the lexical parsing.
By converting the configuration file into the abstract syntax tree, whether preset identification is contained in the abstract syntax tree or not is convenient to detect.
S13, when the abstract syntax tree detects the preset identification, generating the operation request based on the preset identification.
In at least one embodiment of the present invention, the preset identifier includes a readKey and a modifyKey, where the readKey represents reading of the current page, and the modifyKey represents modifying of the current page.
In at least one embodiment of the present disclosure, the operation requests include a read operation request and a modify operation request.
In at least one embodiment of the present invention, the generating, by the electronic device, the operation request based on the preset identifier includes:
(1) when the preset identifier is detected to be a read identifier, the electronic device obtains a key value corresponding to the read identifier, the key value comprises a read source, the electronic device obtains a corresponding value of the read source, the corresponding value comprises a first line number and a first field, and the electronic device encapsulates the read identifier, the first line number and the first field to generate a read operation request;
(2) when the preset identification is detected to be a modification identification, the electronic device obtains a key value corresponding to the modification identification, the key value comprises a first modification object, the electronic device obtains a corresponding value of the first modification object, the electronic device determines a first modification type according to the corresponding value, determines a first modification source according to the corresponding value, and encapsulates the first modification object, the first modification type and the first modification source to generate a modification operation request.
The read identifier may be a readKey, and the modification identifier may be a modifyKey.
Further, the modification types include an addition type, a deletion type, and an alteration type.
Through the embodiment, the corresponding operation request can be generated according to the corresponding preset identifier.
S14, determining the current page of the target item.
In at least one embodiment of the invention, the current page is initially configured with a key-value, i.e., the current page is the page with the earliest occurrence of the key-value.
In at least one embodiment of the present invention, the electronic device determining the current page of the target item comprises:
detecting whether the abstract syntax tree contains a key identification;
when detecting that any abstract syntax tree contains the key identification, acquiring a current configuration file corresponding to the any abstract syntax tree;
and determining the page corresponding to the current configuration file as the current page.
By detecting the abstract syntax tree, the current page can be quickly determined.
S15, based on the operation request, executing the response to the current page, and saving the mapping relation between the operation request and the response result.
It is emphasized that the mapping relationships may also be stored in nodes of a blockchain to further ensure the privacy and security of the mapping relationships.
In at least one embodiment of the present invention, the electronic device, based on the operation request, executing the response to the current page includes:
(1) when the operation request is the reading operation request, the electronic equipment determines an operation page of the reading operation request and analyzes the reading operation request to obtain a second line number and a second field, and the electronic equipment determines a storage value according to the operation page and the second line number and assigns the storage value to a position corresponding to the second field in the current page;
(2) when the operation request is the modification operation request, the electronic device determines an operation page of the modification operation request, analyzes the modification operation request, and obtains a second modification type, a second modification object and a second modification source, the electronic device determines a storage value according to the operation page and the second modification source, determines a target value corresponding to the second modification in the current page, and processes the target value according to the storage value and the second modification type.
Through the embodiment, corresponding responses can be executed according to different types of operation requests.
In at least one embodiment of the present invention, the electronic device stores a mapping relationship between the operation request and the response result, and since parameters such as a reading source or a modification source are recorded in the operation request, the reading source or the modification source of the current page data can be quickly and intuitively acquired through the mapping relationship.
In at least one embodiment of the present invention, after saving the mapping relationship between the operation request and the response result, the method further includes:
establishing an identification code of the mapping relation;
determining the abstract syntax tree of which the preset identification is detected as a target syntax tree, and acquiring a target configuration file corresponding to the target syntax tree;
determining a target page based on the target profile;
storing the corresponding relation between the identification code and the target page;
generating prompt information of the data management instruction based on the corresponding relation;
encrypting the prompt information by adopting a symmetric encryption technology to obtain a ciphertext;
and when the ciphertext is detected to be decrypted successfully, displaying the prompt message.
According to the technical scheme, the reading source or the modification source of the current page data can be quickly and intuitively obtained through the mapping relation, and in addition, the data management code and the service logic code between the pages are separated, so that the whole code quantity on the pages is reduced, and the maintainability and the readability of the codes are improved.
Fig. 2 is a functional block diagram of a page data management device according to a preferred embodiment of the present invention. The page data management apparatus 11 includes a determination unit 110, a construction unit 111, a generation unit 112, an execution unit 113, a creation unit 114, a saving unit 115, an encryption unit 116, and a display unit 117. The module/unit referred to in the present invention refers to a series of computer program segments that can be fetched by the processor 13 and that can perform a fixed function, and that are stored in the memory 12. In the present embodiment, the functions of the modules/units will be described in detail in the following embodiments.
When receiving a data management instruction, the determination unit 110 determines a target item according to the data management instruction.
In at least one embodiment of the present invention, the information carried by the data management instruction includes, but is not limited to: object tags, item names, etc.
In at least one embodiment of the present invention, the determining unit 110 determines the target item according to the data management instruction includes:
the determining unit 110 obtains a target tag, further, the determining unit 110 extracts information corresponding to the target tag from all information carried by the data management instruction as an item name, and further, the determining unit 110 determines the corresponding target item according to the item name.
And the target item can be accurately determined through the mapping relation between the target label and the item name.
The determining unit 110 determines all pages in the target item.
In at least one embodiment of the present invention, each item has a corresponding setting file, that is, a mapping relationship between an item and a setting file is stored in a configuration library of an electronic device, and further, each setting file records a first file path and a second file path, where the first file path represents a position where an item entry file is located, and the second file path represents a position where a configuration file of all pages is located.
In at least one embodiment of the present invention, the all pages include, but are not limited to: detail pages, related pages, etc.
In at least one embodiment of the present invention, the determining unit 110 determines that all pages in the target item include:
acquiring a target setting file corresponding to the target project;
determining a first file path from the target setting file, and acquiring an entry file based on the first file path;
acquiring an item directory from the entry file;
and extracting all page information in the item directory, and determining all pages corresponding to all the page information.
Wherein the page information represents that different pages have different page information, and the page information may include, but is not limited to: page address, etc.
The constructing unit 111 obtains all configuration files corresponding to all the pages, and constructs an abstract syntax tree based on all the configuration files.
In at least one embodiment of the present invention, the obtaining, by the constructing unit 111, all the configuration files corresponding to all the pages includes:
the constructing unit 111 obtains a second file path from the target setting file, and further, the constructing unit 111 obtains all the configuration files from the second file path.
Through the implementation mode, all the configuration files can be acquired quickly.
In at least one embodiment of the present invention, the constructing unit 111 constructs an abstract syntax tree based on all the configuration files, including:
for each configuration file, converting the format of the configuration code of each configuration file into a preset format to obtain a target code with the preset format;
performing lexical analysis on the target code;
carrying out grammar analysis on the target code after lexical analysis to obtain a preprocessing code;
and constructing the abstract syntax tree according to the preprocessing codes.
The preset format is a format capable of generating the abstract syntax tree, and the configuration code is not limited in format by the scheme because the configuration code can be converted into a uniform preset format, and the configuration code may be in a C language format or a JAVA language format. By formatting the configuration codes, a uniform preset format can be obtained, so that the configuration codes in any format can be converted into the uniform preset format after being formatted.
Further, the lexical analysis is to cut the target code into multiple tokens and assign a number to each token. The configuration code is actually cut into multiple tokens and each token is assigned a number in sequence.
Furthermore, the grammar parsing is to combine the words into a sentence with a certain grammar, such as "program", "expression", and the like, based on the lexical parsing.
By converting the configuration file into the abstract syntax tree, whether preset identification is contained in the abstract syntax tree or not is convenient to detect.
When a preset identifier is detected in the abstract syntax tree, the generation unit 112 generates an operation request based on the preset identifier.
In at least one embodiment of the present invention, the preset identifier includes a readKey and a modifyKey, where the readKey represents reading of the current page, and the modifyKey represents modifying of the current page.
In at least one embodiment of the present disclosure, the operation requests include a read operation request and a modify operation request.
In at least one embodiment of the present invention, the generating unit 112 generates the operation request based on the preset identifier, including:
(1) when detecting that the preset identifier is a read identifier, the generating unit 112 obtains a key value corresponding to the read identifier, where the key value includes a read source, the generating unit 112 obtains a corresponding value of the read source, where the corresponding value includes a first row number and a first field, and the generating unit 112 encapsulates the read identifier, the first row number, and the first field, and generates a read operation request;
(2) when it is detected that the preset identifier is a modification identifier, the generating unit 112 obtains a key value corresponding to the modification identifier, where the key value includes a first modification object, the generating unit 112 obtains a corresponding value of the first modification object, the generating unit 112 determines a first modification type according to the corresponding value, and determines a first modification source according to the corresponding value, and the generating unit 112 encapsulates the first modification object, the first modification type, and the first modification source, and generates a modification operation request.
The read identifier may be a readKey, and the modification identifier may be a modifyKey.
Further, the modification types include an addition type, a deletion type, and an alteration type.
Through the embodiment, the corresponding operation request can be generated according to the corresponding preset identifier.
The determining unit 110 determines a current page of the target item.
In at least one embodiment of the invention, the current page is initially configured with a key-value, i.e., the current page is the page with the earliest occurrence of the key-value.
In at least one embodiment of the present invention, the determining unit 110 determines the current page of the target item includes:
detecting whether the abstract syntax tree contains a key identification;
when detecting that any abstract syntax tree contains the key identification, acquiring a current configuration file corresponding to the any abstract syntax tree;
and determining the page corresponding to the current configuration file as the current page.
By detecting the abstract syntax tree, the current page can be quickly determined.
The execution unit 113 executes a response to the current page based on the operation request, and saves a mapping relationship between the operation request and a response result.
It is emphasized that the mapping relationships may also be stored in nodes of a blockchain to further ensure the privacy and security of the mapping relationships.
In at least one embodiment of the present invention, the executing unit 113, based on the operation request, executing the response to the current page includes:
(1) when the operation request is the read operation request, the execution unit 113 determines an operation page of the read operation request, and analyzes the read operation request to obtain a second row number and a second field, and the execution unit 113 determines a stored value according to the operation page and the second row number, and assigns the stored value to a position corresponding to the second field in the current page;
(2) when the operation request is the modify operation request, the execution unit 113 determines an operation page of the modify operation request, and parses the modify operation request to obtain a second modify type, a second modify object, and a second modify source, the execution unit 113 determines a stored value according to the operation page and the second modify source, determines a target value corresponding to the second modification in the current page, and the execution unit 113 processes the target value according to the stored value and the second modify type.
Through the embodiment, corresponding responses can be executed according to different types of operation requests.
In at least one embodiment of the present invention, the execution unit 113 stores a mapping relationship between the operation request and the response result, and since parameters such as a reading source or a modification source are recorded in the operation request, the reading source or the modification source of the current page data can be quickly and intuitively acquired through the mapping relationship.
In at least one embodiment of the present invention, after the mapping relationship between the operation request and the response result is saved, the establishing unit 114 establishes an identification code of the mapping relationship;
the determining unit determines the abstract syntax tree of the detected preset identification as a target syntax tree and acquires a target configuration file corresponding to the target syntax tree;
the determining unit 110 determines a target page based on the target profile;
the saving unit 115 saves the corresponding relationship between the identification code and the target page;
the generating unit 112 generates prompt information of the data management instruction based on the corresponding relation;
the encryption unit 116 encrypts the prompt message by using a symmetric encryption technology to obtain a ciphertext;
when detecting that the ciphertext is decrypted successfully, the display unit 117 displays the hint information.
According to the technical scheme, the reading source or the modification source of the current page data can be quickly and intuitively obtained through the mapping relation, and in addition, the data management code and the service logic code between the pages are separated, so that the whole code quantity on the pages is reduced, and the maintainability and the readability of the codes are improved.
Fig. 3 is a schematic structural diagram of an electronic device implementing a page data management method according to a preferred embodiment of the present invention.
In one embodiment of the present invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and a computer program, such as a page data management program, stored in the memory 12 and executable on the processor 13.
It will be appreciated by a person skilled in the art that the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation of the electronic device 1, and that it may comprise more or less components than shown, or some components may be combined, or different components, e.g. the electronic device 1 may further comprise an input output device, a network access device, a bus, etc.
The Processor 13 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The processor 13 is an operation core and a control center of the electronic device 1, and is connected to each part of the whole electronic device 1 by various interfaces and lines, and executes an operating system of the electronic device 1 and various installed application programs, program codes, and the like.
The processor 13 executes an operating system of the electronic device 1 and various installed application programs. The processor 13 executes the application program to implement the steps in the above-mentioned various embodiments of the page data management method, such as the steps shown in fig. 1.
Alternatively, the processor 13, when executing the computer program, implements the functions of the modules/units in the above device embodiments, for example:
when a data management instruction is received, determining a target project according to the data management instruction;
determining all pages in the target project;
acquiring all configuration files corresponding to all pages, and constructing an abstract syntax tree based on all the configuration files;
when a preset identification is detected in the abstract syntax tree, generating an operation request based on the preset identification;
determining a current page of the target project;
and executing the response to the current page based on the operation request, and storing the mapping relation between the operation request and the response result.
Illustratively, the computer program may be divided into one or more modules/units, which are stored in the memory 12 and executed by the processor 13 to accomplish the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a determination unit 110, a construction unit 111, a generation unit 112, an execution unit 113, a creation unit 114, a saving unit 115, an encryption unit 116, and a display unit 117.
The memory 12 can be used for storing the computer programs and/or modules, and the processor 13 implements various functions of the electronic device 1 by running or executing the computer programs and/or modules stored in the memory 12 and calling data stored in the memory 12. The memory 12 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 12 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other non-volatile solid state storage device.
The memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a memory having a physical form, such as a memory stick, a TF Card (Trans-flash Card), or the like.
The integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented.
Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
With reference to fig. 1, the memory 12 of the electronic device 1 stores a plurality of instructions to implement a page data management method, and the processor 13 can execute the plurality of instructions to implement:
when a data management instruction is received, determining a target project according to the data management instruction;
determining all pages in the target project;
acquiring all configuration files corresponding to all pages, and constructing an abstract syntax tree based on all the configuration files;
when a preset identification is detected in the abstract syntax tree, generating an operation request based on the preset identification;
determining a current page of the target project;
and executing the response to the current page based on the operation request, and storing the mapping relation between the operation request and the response result.
Specifically, the processor 13 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the instruction, which is not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims (10)
1. A page data management method is characterized by comprising the following steps:
when a data management instruction is received, determining a target project according to the data management instruction;
determining all pages in the target project;
acquiring all configuration files corresponding to all pages, and constructing an abstract syntax tree based on all the configuration files;
when a preset identification is detected in the abstract syntax tree, generating an operation request based on the preset identification;
determining a current page of the target project;
and executing the response to the current page based on the operation request, and storing the mapping relation between the operation request and the response result.
2. The page data management method according to claim 1, wherein said determining all pages in said target item comprises:
acquiring a target setting file corresponding to the target project;
determining a first file path from the target setting file, and acquiring an entry file based on the first file path;
acquiring an item directory from the entry file;
and extracting all page information in the item directory, and determining all pages corresponding to all the page information.
3. The page data management method of claim 1, wherein said building an abstract syntax tree based on said all configuration files comprises:
for each configuration file, converting the format of the configuration code of each configuration file into a preset format to obtain a target code with the preset format;
performing lexical analysis on the target code;
carrying out grammar analysis on the target code after lexical analysis to obtain a preprocessing code;
and constructing the abstract syntax tree according to the preprocessing codes.
4. The page data management method according to claim 1, wherein said generating an operation request based on said preset identification comprises:
when the preset identification is detected to be a reading identification, obtaining a key value corresponding to the reading identification, wherein the key value comprises a reading source, obtaining a corresponding value of the reading source, the corresponding value comprises a first line number and a first field, packaging the reading identification, the first line number and the first field, and generating a reading operation request; and/or
When the preset identification is detected to be a modification identification, obtaining a key value corresponding to the modification identification, wherein the key value comprises a first modification object, obtaining a corresponding value of the first modification object, determining a first modification type according to the corresponding value, determining a first modification source according to the corresponding value, packaging the first modification object, the first modification type and the first modification source, and generating a modification operation request.
5. The page data management method according to claim 4, wherein said performing a response to the current page based on the operation request includes:
when the operation request is the reading operation request, determining an operation page of the reading operation request, analyzing the reading operation request to obtain a second line number and a second field, determining a storage value according to the operation page and the second line number, and assigning the storage value to a position corresponding to the second field in the current page; and/or
When the operation request is the modification operation request, determining an operation page of the modification operation request, analyzing the modification operation request to obtain a second modification type, a second modification object and a second modification source, determining a storage value according to the operation page and the second modification source, determining a target value corresponding to the second modification in the current page, and processing the target value according to the storage value and the second modification type.
6. The page data management method of claim 1, wherein said determining a current page of the target item comprises:
detecting whether the abstract syntax tree contains a key identification;
when detecting that any abstract syntax tree contains the key identification, acquiring a current configuration file corresponding to the any abstract syntax tree;
and determining the page corresponding to the current configuration file as the current page.
7. The page data management method according to claim 1, wherein after the mapping relationship between the operation request and the response result is saved, the page data management method further comprises:
establishing an identification code of the mapping relation;
determining the abstract syntax tree of which the preset identification is detected as a target syntax tree, and acquiring a target configuration file corresponding to the target syntax tree;
determining a target page based on the target profile;
storing the corresponding relation between the identification code and the target page;
generating prompt information of the data management instruction based on the corresponding relation;
encrypting the prompt information by adopting a symmetric encryption technology to obtain a ciphertext;
and when the ciphertext is detected to be decrypted successfully, displaying the prompt message.
8. A page data management apparatus, characterized in that the page data management apparatus comprises:
the determining unit is used for determining a target project according to a data management instruction when the data management instruction is received;
the determining unit is further configured to determine all pages in the target project;
the constructing unit is used for acquiring all configuration files corresponding to all the pages and constructing an abstract syntax tree based on all the configuration files;
the generating unit is used for generating an operation request based on a preset identifier when the preset identifier is detected in the abstract syntax tree;
the determining unit is further configured to determine a current page of the target item;
and the execution unit is used for executing the response to the current page based on the operation request and storing the mapping relation between the operation request and the response result.
9. An electronic device, characterized in that the electronic device comprises:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the page data management method of any of claims 1 to 7.
10. A computer-readable storage medium characterized by: the computer-readable storage medium has stored therein at least one instruction that is executed by a processor in an electronic device to implement the page data management method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010610728.1A CN111797351A (en) | 2020-06-29 | 2020-06-29 | Page data management method and device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010610728.1A CN111797351A (en) | 2020-06-29 | 2020-06-29 | Page data management method and device, electronic equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111797351A true CN111797351A (en) | 2020-10-20 |
Family
ID=72809777
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010610728.1A Pending CN111797351A (en) | 2020-06-29 | 2020-06-29 | Page data management method and device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111797351A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112671734A (en) * | 2020-12-16 | 2021-04-16 | 中国平安人寿保险股份有限公司 | Message processing method facing multiple data sources and related equipment thereof |
CN112905388A (en) * | 2021-03-15 | 2021-06-04 | 杭州迪普科技股份有限公司 | Page configuration information processing method and device |
CN113448605A (en) * | 2021-06-29 | 2021-09-28 | 北京高途云集教育科技有限公司 | Software updating method and device, electronic equipment and storage medium |
CN114237746A (en) * | 2021-12-16 | 2022-03-25 | 北京天融信网络安全技术有限公司 | C language-based configuration information management method, device, equipment and storage medium |
CN114357337A (en) * | 2022-01-11 | 2022-04-15 | 平安普惠企业管理有限公司 | Cache management method, device, equipment and storage medium |
CN116186046A (en) * | 2023-02-24 | 2023-05-30 | 深圳乐信软件技术有限公司 | Device data modification method and device, computer device and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104572638A (en) * | 2013-10-09 | 2015-04-29 | 腾讯科技(深圳)有限公司 | Data reading and writing method and device |
CN109635175A (en) * | 2018-11-06 | 2019-04-16 | 北京字节跳动网络技术有限公司 | Page data joining method, device, readable storage medium storing program for executing and electronic equipment |
CN110389755A (en) * | 2019-07-24 | 2019-10-29 | 网易(杭州)网络有限公司 | Code process method and device, electronic equipment and computer readable storage medium |
CN110647320A (en) * | 2019-08-14 | 2020-01-03 | 平安普惠企业管理有限公司 | Project framework construction method and device, computer equipment and storage medium |
CN111124861A (en) * | 2019-12-19 | 2020-05-08 | 广州品唯软件有限公司 | Recording method of webpage data, recording device of webpage data and readable storage medium |
-
2020
- 2020-06-29 CN CN202010610728.1A patent/CN111797351A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104572638A (en) * | 2013-10-09 | 2015-04-29 | 腾讯科技(深圳)有限公司 | Data reading and writing method and device |
CN109635175A (en) * | 2018-11-06 | 2019-04-16 | 北京字节跳动网络技术有限公司 | Page data joining method, device, readable storage medium storing program for executing and electronic equipment |
CN110389755A (en) * | 2019-07-24 | 2019-10-29 | 网易(杭州)网络有限公司 | Code process method and device, electronic equipment and computer readable storage medium |
CN110647320A (en) * | 2019-08-14 | 2020-01-03 | 平安普惠企业管理有限公司 | Project framework construction method and device, computer equipment and storage medium |
CN111124861A (en) * | 2019-12-19 | 2020-05-08 | 广州品唯软件有限公司 | Recording method of webpage data, recording device of webpage data and readable storage medium |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112671734A (en) * | 2020-12-16 | 2021-04-16 | 中国平安人寿保险股份有限公司 | Message processing method facing multiple data sources and related equipment thereof |
CN112905388A (en) * | 2021-03-15 | 2021-06-04 | 杭州迪普科技股份有限公司 | Page configuration information processing method and device |
CN112905388B (en) * | 2021-03-15 | 2023-12-15 | 杭州迪普科技股份有限公司 | Page configuration information processing method and device |
CN113448605A (en) * | 2021-06-29 | 2021-09-28 | 北京高途云集教育科技有限公司 | Software updating method and device, electronic equipment and storage medium |
CN113448605B (en) * | 2021-06-29 | 2024-02-09 | 北京高途云集教育科技有限公司 | Software updating method and device, electronic equipment and storage medium |
CN114237746A (en) * | 2021-12-16 | 2022-03-25 | 北京天融信网络安全技术有限公司 | C language-based configuration information management method, device, equipment and storage medium |
CN114237746B (en) * | 2021-12-16 | 2023-11-14 | 北京天融信网络安全技术有限公司 | Configuration information management method, device, equipment and storage medium based on C language |
CN114357337A (en) * | 2022-01-11 | 2022-04-15 | 平安普惠企业管理有限公司 | Cache management method, device, equipment and storage medium |
CN116186046A (en) * | 2023-02-24 | 2023-05-30 | 深圳乐信软件技术有限公司 | Device data modification method and device, computer device and storage medium |
CN116186046B (en) * | 2023-02-24 | 2024-02-20 | 深圳市乐信信息服务有限公司 | Device data modification method and device, computer device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111694840B (en) | Data synchronization method, device, server and storage medium | |
CN111797351A (en) | Page data management method and device, electronic equipment and medium | |
CN111638908A (en) | Interface document generation method and device, electronic equipment and medium | |
CN111639284A (en) | Webpage labeling method and device, electronic equipment and medium | |
CN111796809A (en) | Interface document generation method and device, electronic equipment and medium | |
CN111881209A (en) | Data synchronization method and device for heterogeneous database, electronic equipment and medium | |
CN112667240A (en) | Program code conversion method and related device | |
CN112948418A (en) | Dynamic query method, device, equipment and storage medium | |
CN112711398A (en) | Method, device and equipment for generating buried point file and storage medium | |
CN114035827A (en) | Application program updating method, device, equipment and storage medium | |
CN112433705A (en) | Script generation method and device, electronic equipment and storage medium | |
CN116360769A (en) | Code generation method, device, equipment and storage medium | |
CN112001159A (en) | Document generation method and device, electronic equipment and storage medium | |
CN111814045A (en) | Data query method and device, electronic equipment and storage medium | |
CN114116108A (en) | Dynamic rendering method, device, equipment and storage medium | |
CN111933241B (en) | Medical data analysis method, device, electronic equipment and storage medium | |
CN112434062A (en) | Quasi-real-time data processing method, device, server and storage medium | |
CN116089535A (en) | Data synchronization method, device, equipment and storage medium | |
CN112395319B (en) | Cache sharing method and device, server and storage medium | |
WO2021103409A1 (en) | Data generation method and apparatus, electronic device and storage medium | |
CN114610386A (en) | Interaction method, device, equipment and storage medium of H5 and application program | |
CN114692204A (en) | Data query method, device, equipment and storage medium | |
CN114968725A (en) | Task dependency relationship correction method and device, computer equipment and storage medium | |
CN114329095A (en) | System logic diagram generation method, device, equipment and storage medium | |
CN111209075B (en) | Multilingual interface maintenance method, system, storage medium and intelligent device |
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 |