CN111753238A - Data mapping method and device and electronic equipment - Google Patents

Data mapping method and device and electronic equipment Download PDF

Info

Publication number
CN111753238A
CN111753238A CN202010504291.3A CN202010504291A CN111753238A CN 111753238 A CN111753238 A CN 111753238A CN 202010504291 A CN202010504291 A CN 202010504291A CN 111753238 A CN111753238 A CN 111753238A
Authority
CN
China
Prior art keywords
mapping
data
service data
file
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010504291.3A
Other languages
Chinese (zh)
Inventor
毕剑龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju 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 Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202010504291.3A priority Critical patent/CN111753238A/en
Publication of CN111753238A publication Critical patent/CN111753238A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Abstract

The embodiment of the disclosure discloses a data mapping method, a data mapping device, electronic equipment and a computer-readable storage medium. The data mapping method comprises the following steps: acquiring a mapping file, wherein the mapping file comprises at least one mapping object, and the mapping object comprises a mapping name; acquiring a service data file, wherein the service data file comprises at least one service data; acquiring first service data corresponding to the mapping name of the mapping object from the service data file; acquiring a template file, wherein the template file comprises at least one template object; and mapping the first service data to a template object corresponding to the mapping object to obtain a data file. By the mapping file, the service data file and the template file in the method, the technical problem that data updating is not flexible when a page is generated and updated in the prior art is solved.

Description

Data mapping method and device and electronic equipment
Technical Field
The present disclosure relates to the field of page processing, and in particular, to a data mapping method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the development of computer networks and the popularization of smart phones, users often use terminal devices to browse content in the networks, and often access network pages to browse pictures, texts, videos, audios and the like in the networks, so that designers or developers of the pages are required to design or develop related pages in advance, lay out the content on the pages and distribute the content after filling the content, and the users access the pages through network addresses of the pages.
In the prior art, the page display and editing functions of the landing page of H5 are implemented based on Json (Json object Notation), data on the landing page is divided into multiple types of components, such as texts, pictures, videos, and the like, each having a different data structure, and when the page is rendered and displayed, the data is sent to each Vue (progressive frame for constructing a user interface) component according to the component name to be initialized.
The generation of the Json data needs to be implemented on an editor basis. However, the existing method is very inflexible, actual data to be displayed in a page needs to be directly edited into the page during editing, and when business data is modified, the page needs to be manually adjusted, so that the method is very inflexible. Therefore, a method for rapidly updating the data to be displayed on the page is needed.
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.
In a first aspect, an embodiment of the present disclosure provides a data mapping method, including:
acquiring a mapping file, wherein the mapping file comprises at least one mapping object, and the mapping object comprises a mapping name;
acquiring a service data file, wherein the service data file comprises at least one service data;
acquiring first service data corresponding to the mapping name of the mapping object from the service data file;
acquiring a template file, wherein the template file comprises at least one template object;
and mapping the first service data to a template object corresponding to the mapping object to obtain a data file.
In a second aspect, an embodiment of the present disclosure provides a data mapping apparatus, including:
the mapping file acquisition module is used for acquiring a mapping file, wherein the mapping file comprises at least one mapping object, and the mapping object comprises a mapping name;
the service data file acquisition module is used for acquiring a service data file, and the service data file comprises at least one service data;
a service data acquisition module, configured to acquire, from the service data file, first service data corresponding to the mapping name of the mapping object;
the template file acquisition module is used for acquiring a template file, and the template file comprises at least one template object;
and the data mapping module is used for mapping the first service data to a template object corresponding to the mapping object to obtain a data file.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the data mapping method of any of the preceding first aspects.
In a fourth aspect, the disclosed embodiments provide a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the data mapping method of any one of the foregoing first aspects.
The embodiment of the disclosure discloses a data mapping method, a data mapping device, electronic equipment and a computer-readable storage medium. The data mapping method comprises the following steps: acquiring a mapping file, wherein the mapping file comprises at least one mapping object, and the mapping object comprises a mapping name; acquiring a service data file, wherein the service data file comprises at least one service data; acquiring first service data corresponding to the mapping name of the mapping object from the service data file; acquiring a template file, wherein the template file comprises at least one template object; and mapping the first service data to a template object corresponding to the mapping object to obtain a data file. By the mapping file, the service data file and the template file in the method, the technical problem that data updating is not flexible when a page is generated and updated in the prior art is solved.
The foregoing is a summary of the present disclosure, and for the purposes of promoting a clear understanding of the technical means of the present disclosure, the present disclosure may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
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.
Fig. 1 is a schematic view of an application scenario of an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of a data mapping method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a specific example of step S205 in the data mapping method according to the embodiment of the disclosure;
fig. 4 is a schematic diagram of another specific example of step S205 in the data mapping method provided in the embodiment of the present disclosure;
fig. 5 is a schematic diagram of another specific example of step S205 in the data mapping method according to the embodiment of the disclosure;
fig. 6 is a schematic structural diagram of an embodiment of a data mapping apparatus provided in an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device provided 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.
Fig. 1 is a schematic view of an application scenario of the embodiment of the present disclosure. As shown in fig. 1, a user 105 edits a page at a terminal 101, the page saved or released after the completion of the editing is transmitted to a server 102, data of the page is verified in the server 102, and if the verification is passed, the page is saved into a database 103; then, the user 106 browses the page through the terminal 104, the terminal 104 sends a request of the relevant page to the database 103, the database 103 returns page data to the terminal 104, and a page display component in the terminal 104 analyzes and renders the page.
Fig. 2 is a flowchart of an embodiment of a data mapping method provided in an embodiment of the present disclosure, where the data mapping method provided in this embodiment may be executed by a data mapping apparatus, the data mapping apparatus may be implemented as software, or implemented as a combination of software and hardware, and the data mapping apparatus may be integrally disposed in a certain device in a data mapping system, such as a data mapping server or a data mapping terminal device. As shown in fig. 2, the method comprises the steps of:
step S201, obtaining a mapping file, wherein the mapping file comprises at least one mapping object, and the mapping object comprises a mapping name;
in this embodiment, the mapping file is a file with a predetermined format, in which the name of the data to be mapped is recorded. The mapping file comprises at least one mapping object, the mapping object comprises a mapping name, and each mapping object represents a mapping relation. Illustratively, the map objects in the map file are as follows:
Figure BDA0002525956220000051
Figure BDA0002525956220000061
the mapping object comprises an address, a name. Data between braces of the map object is a data item of the object, where the data item of the object includes an identification of the data item and a value of the data item, such as "child Id": child2Id ", which is the identification of the data item, and" child2Id "which is the value of the data item. The structures of other objects are similar to those of the above objects, and the structures thereof will not be described again.
Step S202, acquiring a service data file, wherein the service data file comprises at least one service data;
in this embodiment, the service data file stores data that actually needs to be displayed on a page, and exemplarily, the service data in the service data file is as follows:
Figure BDA0002525956220000062
the "Beijing zoo-ticket gate" and "Beijing zoo in 137 # of the west direct gate of Hai lake district of Beijing city" are business data, and the name and address in the business data file are the identifications of the business data.
Step S203, acquiring first service data corresponding to the mapping name of the mapping object from the service data file;
in this embodiment, the service data corresponding to the mapping name is searched in the service data file by the mapping name. Illustratively, taking the example in step S201 and step S202 as an example, traversing the mapping object in the mapping file in step S201, obtaining that all mapping names in the mapping file include "address" and "name", respectively using the address and the name as keywords to query in the service data file, and obtaining that the service data corresponding to the address is "beijing zoo inside", No. 137 beijing zoo outside the west direct gate of the hai lake district of beijing ", and the service data corresponding to the name is" beijing zoo-Ticket Port ". The service data file may include a plurality of service data, and the service data that can correspond to the mapping object name is the service data that needs to be mapped at this time, which is called first service data.
Step S204, acquiring a template file, wherein the template file comprises at least one template object;
in this embodiment, the template file is a file for storing page template data, in which data items to be displayed on a page are stored, where the data items have default values or original values. Illustratively, the contents of the template file are as follows:
Figure BDA0002525956220000071
wherein, the 'child 1 Id': and 'child 2 Id': are template objects, the data items in the template objects define the display positions, the display contents and the like of the components on the page, and the service data is the display contents in the components in the template objects.
Step S205, mapping the first service data to a template object corresponding to the mapping object to obtain a data file.
In this embodiment, the first service data obtained in step S202 is mapped to the data item of the template object obtained in step S204 to obtain a data file, where the data file is a template file filled with service data, and the page rendering engine obtains a page with the service data by processing the data file. According to the example in step S204, an example of a data file is as follows:
Figure BDA0002525956220000072
Figure BDA0002525956220000081
in one embodiment, the mapping the object in step S201 further includes: the template object comprises a first identifier and a value of the first identifier, wherein the value of the first identifier corresponds to the name of the template object. Wherein the first identifier is a data item in the mapping object, the value of the first identifier is a value of a data item of the mapping object, taking the example in step S201 as an example, the data item "child id" in each mapping object is the first identifier, and "child1Id" and "child2Id" are values of the first identifier corresponding thereto, and on this basis, the step S205 includes:
step S301, obtaining a value of a first identifier of a mapping object corresponding to the first service data;
step S302, mapping the first service data to a first template object corresponding to the value of the first identifier to obtain a data file.
Taking the above example as an example to explain step S301 and step S302, in step S301, a first identification value of a mapping object corresponding to the first service data is obtained, for example, the first service data is: address, in Beijing zoo in 137 # of overseas great west street in Hai lake district, Beijing, the mapping object corresponding to address is: the value of the first identifier 'childId' of the object in the mapping file is found as follows: "child2 Id"; in step S302, a template object in the template file is found through "child2Id", where the template object corresponding to "child2Id" is: the "child2Id": is the first template object in step S302, and then the address: "137 Beijing zoo outside the Western Toyork in Hai lake district, Beijing" is mapped to the address data item in the template object "child2Id": to obtain:
Figure BDA0002525956220000082
Figure BDA0002525956220000091
and executing the mapping operation on each template object in the template file to obtain a data file.
In another embodiment, the mapping the object in step S201 further includes: and the value of the second identifier corresponds to the template object data identifier in the template object. Taking the example in step S201 as an example, the preset data item "key" in each mapping object is the second identifier, and "address" and "content" are values of the second identifier corresponding thereto, on the basis that the second identifier is a preset data item in the mapping object, the value of the second identifier is a value of the preset data item of the mapping object, the step S205 includes:
step S401, obtaining a value of a first identifier of a mapping object corresponding to the first service data;
step S402, acquiring a first template object corresponding to the value of the first identifier;
step S403, acquiring a first template object data item in the first template object corresponding to the value of the second identifier;
step S404, replacing the first template object data item with the first service data to obtain a data file.
Taking the above example as an example to explain step S401 to step S404, in step S401, a first identification value of a mapping object corresponding to the first service data is obtained, for example, the first service data is: name, Beijing zoo-ticket gate, the mapping object corresponding to the name is: name { }, the value of the first identifier "childId" for finding the object in the mapping file is: "child1 Id"; in step S402, a template object with a template object name of "child1Id" is searched for in the template file according to "child1Id", child1Id ": { }, mark as the first template object; in step S403, the second identifier is a data item with a preset name "key", and the value of the second identifier is the value "content" of "key"; in step S404, from the first template object:
Figure BDA0002525956220000092
Figure BDA0002525956220000101
the template object data item with the data item identification of "content" is searched for, and then the first service data is used: name, replacing the template object data item by Beijing zoo-ticket gate to obtain a replaced template object; and carrying out the replacement operation on each template object which needs to be subjected to the replacement operation in the template file to obtain a data file. One example of a replaced first template object is:
Figure BDA0002525956220000102
in another embodiment, the mapping of the data is implemented using the newly created fusion object. On the basis that the mapping object includes a mapping object name, a first identifier, and values of the first identifier and values of the second identifier, the S205 includes:
step S501, creating a fusion object, wherein the fusion object comprises at least one sub-fusion object; the object name of the sub-fusion object is the value of the first identifier, the object data identifier in the sub-fusion object is the value of the second identifier, and the value of the object data identifier of the sub-fusion object is the first service data;
and step S502, fusing the fusion object and the template object to obtain a data file.
Also taking the example in the above step S201-step S205 as an example, in step S501, a fusion object is created, and the fusion object is similar to the template file in the file structure, such as the fusion object is mergeData: { }, the fusion object includes at least one sub-fusion object, where the sub-fusion object corresponds to a template object in a template file, and when the sub-fusion object of the fusion object is generated, the mapping object in the mapping file is traversed, a value of the second identifier is used as a name of the sub-fusion object, and first service data corresponding to the value of the first identifier is used as a data item of the sub-fusion object, and according to the example in the above example, the obtained fusion object is as follows:
Figure BDA0002525956220000103
Figure BDA0002525956220000111
wherein, the mergeData is the name of the fusion object, child2Id { } and child1Id { } are child fusion objects of the fusion object, and respectively correspond to the template objects in the template file, and the data items in the child fusion objects are the data items to be replaced in the template objects.
In step S502, the fusion object and the template object are fused according to the "key" value of the mapping object in the mapping file, so as to obtain a data file.
In one embodiment, a default value is included in the mapping object; the acquiring of the first service data corresponding to the mapping name of the mapping object from the service data file includes: and in response to that no first service data corresponding to the mapping name of the mapping object exists in the service data file, taking the default value as the first service data. As shown in the example in step S201, each mapping object includes a data item "default", which sets a default value of the service data corresponding to the mapping object, and when the corresponding service data is not found in the service data file by the name of the mapping object, the default value is used as the value of the corresponding data item in the template object. For example, if the mapping object "address" has no service data of the object in the service data file, a null value "is assigned to the" address "data item in the template object" child2Id ".
And after the data file is obtained, a rendering engine of the page generates a page of the data file object according to the data file.
By the mapping file, the mapping relation between the service data and the template object in the template file can be flexibly configured, so that the effect of automatically filling the template file is realized. Therefore, in the stage of generating the new page, the user can quickly generate the page through the existing template by setting the service data; when the content of the page changes, the page does not need to be regenerated, and only the updated data needs to be put into the service data file, so that the data of the long-term page can be automatically replaced and updated.
The embodiment of the disclosure discloses a data mapping method, a data mapping device, electronic equipment and a computer-readable storage medium. The data mapping method comprises the following steps: acquiring a mapping file, wherein the mapping file comprises at least one mapping object, and the mapping object comprises a mapping name; acquiring a service data file, wherein the service data file comprises at least one service data; acquiring first service data corresponding to the mapping name of the mapping object from the service data file; acquiring a template file, wherein the template file comprises at least one template object; and mapping the first service data to a template object corresponding to the mapping object to obtain a data file. By the mapping file, the service data file and the template file in the method, the technical problem that data updating is not flexible when a page is generated and updated in the prior art is solved.
In the above, although the steps in the above method embodiments are described in the above sequence, it should be clear to those skilled in the art that the steps in the embodiments of the present disclosure are not necessarily performed in the above sequence, and may also be performed in other sequences such as reverse, parallel, and cross, and further, on the basis of the above steps, other steps may also be added by those skilled in the art, and these obvious modifications or equivalents should also be included in the protection scope of the present disclosure, and are not described herein again.
Fig. 6 is a schematic structural diagram of an embodiment of a data mapping apparatus provided in the embodiment of the present disclosure, and as shown in fig. 6, the apparatus 600 includes: a mapping file obtaining module 601, a service data file obtaining module 602, a service data obtaining module 603, a template file obtaining module 604 and a data mapping module 605. Wherein the content of the first and second substances,
a mapping file obtaining module 601, configured to obtain a mapping file, where the mapping file includes at least one mapping object, and the mapping object includes a mapping name;
a service data file obtaining module 602, configured to obtain a service data file, where the service data file includes at least one service data;
a service data obtaining module 603, configured to obtain, from the service data file, first service data corresponding to the mapping name of the mapping object;
a template file obtaining module 604, configured to obtain a template file, where the template file includes at least one template object;
a data mapping module 605, configured to map the first service data to a template object corresponding to the mapping object to obtain a data file.
Further, the mapping object further includes:
the template object comprises a first identifier and a value of the first identifier, wherein the value of the first identifier corresponds to the name of the template object.
Further, the data mapping module 605 is further configured to:
acquiring a value of a first identifier of a mapping object corresponding to the first service data;
and mapping the first service data to a first template object corresponding to the value of the first identifier to obtain a data file.
Further, the mapping object further includes:
and the value of the second identifier corresponds to the template object data identifier in the template object.
Further, the data mapping module 605 is further configured to:
acquiring a value of a first identifier of a mapping object corresponding to the first service data;
acquiring a first template object corresponding to the value of the first identifier;
acquiring a first template object data item in a first template object corresponding to the value of the second identifier;
and replacing the first template object data item with the first service data to obtain a data file.
Further, the data mapping module 605 is further configured to:
creating a fusion object, wherein the fusion object comprises at least one sub-fusion object;
the object name of the sub-fusion object is the value of the first identifier, the object data identifier in the sub-fusion object is the value of the second identifier, and the value of the object data identifier of the sub-fusion object is the first service data;
and fusing the fused object and the template object to obtain a data file.
Further, the mapping object comprises a default value; the service data file obtaining module 602 is further configured to: and in response to that no first service data corresponding to the mapping name of the mapping object exists in the service data file, taking the default value as the first service data.
The apparatus shown in fig. 6 can perform the method of the embodiment shown in fig. 2-5, and the detailed description of this embodiment can refer to the related description of the embodiment shown in fig. 2-5. The implementation process and technical effect of the technical solution refer to the descriptions in the embodiments shown in fig. 2 to fig. 5, and are not described herein again.
Referring now to FIG. 7, shown is a schematic diagram of an electronic device 700 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. 7 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. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 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 embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, 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.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring elements in a page; judging the level of the element in the page; and calling the elements with the same hierarchy to process and display the elements in a collision processing mode corresponding to the hierarchy.
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.
According to one or more embodiments of the present disclosure, there is provided a data mapping method including:
acquiring a mapping file, wherein the mapping file comprises at least one mapping object, and the mapping object comprises a mapping name;
acquiring a service data file, wherein the service data file comprises at least one service data;
acquiring first service data corresponding to the mapping name of the mapping object from the service data file;
acquiring a template file, wherein the template file comprises at least one template object;
and mapping the first service data to a template object corresponding to the mapping object to obtain a data file.
Further, the mapping object further includes:
the template object comprises a first identifier and a value of the first identifier, wherein the value of the first identifier corresponds to the name of the template object.
Further, mapping the first service data to a template object corresponding to the mapping object to obtain a data file includes:
acquiring a value of a first identifier of a mapping object corresponding to the first service data;
and mapping the first service data to a first template object corresponding to the value of the first identifier to obtain a data file.
Further, the mapping object further includes:
and the value of the second identifier corresponds to the template object data identifier in the template object.
Further, mapping the first service data to a template object corresponding to the mapping object to obtain a data file includes:
acquiring a value of a first identifier of a mapping object corresponding to the first service data;
acquiring a first template object corresponding to the value of the first identifier;
acquiring a first template object data item in a first template object corresponding to the value of the second identifier;
and replacing the first template object data item with the first service data to obtain a data file.
Further, mapping the first service data to a template object corresponding to the mapping object to obtain a data file includes:
creating a fusion object, wherein the fusion object comprises at least one sub-fusion object;
the object name of the sub-fusion object is the value of the first identifier, the object data identifier in the sub-fusion object is the value of the second identifier, and the value of the object data identifier of the sub-fusion object is the first service data;
and fusing the fused object and the template object to obtain a data file.
Further, the mapping object comprises a default value;
the acquiring of the first service data corresponding to the mapping name of the mapping object from the service data file includes:
and in response to that no first service data corresponding to the mapping name of the mapping object exists in the service data file, taking the default value as the first service data.
According to one or more embodiments of the present disclosure, there is provided a data mapping apparatus including:
the mapping file acquisition module is used for acquiring a mapping file, wherein the mapping file comprises at least one mapping object, and the mapping object comprises a mapping name;
the service data file acquisition module is used for acquiring a service data file, and the service data file comprises at least one service data;
a service data acquisition module, configured to acquire, from the service data file, first service data corresponding to the mapping name of the mapping object;
the template file acquisition module is used for acquiring a template file, and the template file comprises at least one template object;
and the data mapping module is used for mapping the first service data to a template object corresponding to the mapping object to obtain a data file.
Further, the mapping object further includes:
the template object comprises a first identifier and a value of the first identifier, wherein the value of the first identifier corresponds to the name of the template object.
Further, the data mapping module is further configured to:
acquiring a value of a first identifier of a mapping object corresponding to the first service data;
and mapping the first service data to a first template object corresponding to the value of the first identifier to obtain a data file.
Further, the mapping object further includes:
and the value of the second identifier corresponds to the template object data identifier in the template object.
Further, the data mapping module is further configured to:
acquiring a value of a first identifier of a mapping object corresponding to the first service data;
acquiring a first template object corresponding to the value of the first identifier;
acquiring a first template object data item in a first template object corresponding to the value of the second identifier;
and replacing the first template object data item with the first service data to obtain a data file.
Further, the data mapping module is further configured to:
creating a fusion object, wherein the fusion object comprises at least one sub-fusion object;
the object name of the sub-fusion object is the value of the first identifier, the object data identifier in the sub-fusion object is the value of the second identifier, and the value of the object data identifier of the sub-fusion object is the first service data;
and fusing the fused object and the template object to obtain a data file.
Further, the mapping object comprises a default value; the service data file obtaining module is further configured to: and in response to that no first service data corresponding to the mapping name of the mapping object exists in the service data file, taking the default value as the first service data.
According to one or more embodiments of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the data mapping method of any of the preceding first aspects.
According to one or more embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, characterized in that the non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the data mapping method of any one of the preceding first aspects.
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.

Claims (10)

1. A data mapping method, comprising:
acquiring a mapping file, wherein the mapping file comprises at least one mapping object, and the mapping object comprises a mapping name;
acquiring a service data file, wherein the service data file comprises at least one service data;
acquiring first service data corresponding to the mapping name of the mapping object from the service data file;
acquiring a template file, wherein the template file comprises at least one template object;
and mapping the first service data to a template object corresponding to the mapping object to obtain a data file.
2. The data mapping method of claim 1, wherein the mapping object further comprises:
the template object comprises a first identifier and a value of the first identifier, wherein the value of the first identifier corresponds to the name of the template object.
3. The data mapping method according to claim 2, wherein the mapping the first service data to the template object corresponding to the mapping object to obtain a data file comprises:
acquiring a value of a first identifier of a mapping object corresponding to the first service data;
and mapping the first service data to a first template object corresponding to the value of the first identifier to obtain a data file.
4. The data mapping method of claim 2, wherein the mapping object further comprises:
and the value of the second identifier corresponds to the template object data identifier in the template object.
5. The data mapping method according to claim 4, wherein the mapping the first service data to the template object corresponding to the mapping object to obtain a data file comprises:
acquiring a value of a first identifier of a mapping object corresponding to the first service data;
acquiring a first template object corresponding to the value of the first identifier;
acquiring a first template object data item in a first template object corresponding to the value of the second identifier;
and replacing the first template object data item with the first service data to obtain a data file.
6. The data mapping method according to claim 4, wherein the mapping the first service data to the template object corresponding to the mapping object to obtain a data file comprises:
creating a fusion object, wherein the fusion object comprises at least one sub-fusion object;
the object name of the sub-fusion object is the value of the first identifier, the object data identifier in the sub-fusion object is the value of the second identifier, and the value of the object data identifier of the sub-fusion object is the first service data;
and fusing the fused object and the template object to obtain a data file.
7. The data mapping method of claim 1, wherein:
the mapping object comprises a default value;
the acquiring of the first service data corresponding to the mapping name of the mapping object from the service data file includes:
and in response to that no first service data corresponding to the mapping name of the mapping object exists in the service data file, taking the default value as the first service data.
8. A data mapping apparatus, comprising:
the mapping file acquisition module is used for acquiring a mapping file, wherein the mapping file comprises at least one mapping object, and the mapping object comprises a mapping name;
the service data file acquisition module is used for acquiring a service data file, and the service data file comprises at least one service data;
a service data acquisition module, configured to acquire, from the service data file, first service data corresponding to the mapping name of the mapping object;
the template file acquisition module is used for acquiring a template file, and the template file comprises at least one template object;
and the data mapping module is used for mapping the first service data to a template object corresponding to the mapping object to obtain a data file.
9. An electronic device, comprising:
a memory for storing computer readable instructions; and
a processor for executing the computer readable instructions such that the processor when executed implements the data mapping method of any of claims 1-7.
10. A non-transitory computer readable storage medium storing computer readable instructions which, when executed by a computer, cause the computer to perform the data mapping method of any one of claims 1-7.
CN202010504291.3A 2020-06-05 2020-06-05 Data mapping method and device and electronic equipment Pending CN111753238A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010504291.3A CN111753238A (en) 2020-06-05 2020-06-05 Data mapping method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010504291.3A CN111753238A (en) 2020-06-05 2020-06-05 Data mapping method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111753238A true CN111753238A (en) 2020-10-09

Family

ID=72675950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010504291.3A Pending CN111753238A (en) 2020-06-05 2020-06-05 Data mapping method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111753238A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732641A (en) * 2020-12-30 2021-04-30 山东浪潮通软信息科技有限公司 Electronic file filing method, device and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102340704A (en) * 2010-07-16 2012-02-01 中国联合网络通信集团有限公司 Asynchronous dynamic page switching method and system and server
US20140358820A1 (en) * 2013-06-04 2014-12-04 International Business Machines Corporation Computer assisted classification of packaged application objects and associated customizations into a business process hierarchy
CN110020353A (en) * 2017-09-30 2019-07-16 北京国双科技有限公司 The construction method and device of web form
CN110764995A (en) * 2019-09-05 2020-02-07 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for detecting file access abnormity
US20200125392A1 (en) * 2018-10-17 2020-04-23 International Business Machines Corporation Filesystem using hardware transactional memory on non-volatile dual in-line memory module
CN111158800A (en) * 2019-12-31 2020-05-15 北京明略软件系统有限公司 Method and device for constructing task DAG based on mapping relation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102340704A (en) * 2010-07-16 2012-02-01 中国联合网络通信集团有限公司 Asynchronous dynamic page switching method and system and server
US20140358820A1 (en) * 2013-06-04 2014-12-04 International Business Machines Corporation Computer assisted classification of packaged application objects and associated customizations into a business process hierarchy
CN110020353A (en) * 2017-09-30 2019-07-16 北京国双科技有限公司 The construction method and device of web form
US20200125392A1 (en) * 2018-10-17 2020-04-23 International Business Machines Corporation Filesystem using hardware transactional memory on non-volatile dual in-line memory module
CN110764995A (en) * 2019-09-05 2020-02-07 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for detecting file access abnormity
CN111158800A (en) * 2019-12-31 2020-05-15 北京明略软件系统有限公司 Method and device for constructing task DAG based on mapping relation

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732641A (en) * 2020-12-30 2021-04-30 山东浪潮通软信息科技有限公司 Electronic file filing method, device and medium

Similar Documents

Publication Publication Date Title
CN111581563B (en) Page response method and device, storage medium and electronic equipment
CN109491742B (en) Page table rendering method and device
CN111368519B (en) Method, device, equipment and storage medium for editing online form
CN112487331A (en) Page generation method and device, storage medium and electronic equipment
CN111857720B (en) User interface state information generation method and device, electronic equipment and medium
CN113157153A (en) Content sharing method and device, electronic equipment and computer readable storage medium
CN111596991A (en) Interactive operation execution method and device and electronic equipment
CN110704833A (en) Data permission configuration method, device, electronic device and storage medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN115757400A (en) Data table processing method and device, electronic equipment and computer readable medium
CN111381819B (en) List creation method and device, electronic equipment and computer-readable storage medium
CN111756953A (en) Video processing method, device, equipment and computer readable medium
CN111949746A (en) Data processing method and device, electronic equipment and computer readable medium
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN111753238A (en) Data mapping method and device and electronic equipment
CN112965713B (en) Development method, device, equipment and storage medium of visual editor
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN110780898B (en) Page data upgrading method and device and electronic equipment
CN111240657A (en) Method and device for generating SDK and electronic equipment
CN111324349A (en) Method, device, terminal and storage medium for generating interactive interface
CN112579218A (en) User interface display method and device, computer readable medium and electronic equipment
CN111405342B (en) Rich text message display method, device, system, medium and electronic equipment
CN116701181B (en) Information verification flow display method, device, equipment and computer readable medium
CN112346728B (en) Device adaptation method, apparatus, device and computer readable medium
CN111008178A (en) Data processing method and device, electronic equipment and computer readable storage medium

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