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 disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments 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 noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
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.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram 100 of one application scenario of a method of data processing according to some embodiments of the present disclosure.
As shown in fig. 1, the computing device 101 performs a classification and conversion process shown by reference numeral 105 for attribute 1 and attribute value 1 of the first frame, attribute 2 and attribute value 2 of the first frame, and attribute 3 and attribute value 3 of the first frame, which are shown by reference numerals 102, 103, and 104, respectively. And obtaining the attribute and the attribute value required by the second frame. As an example, the first frame may be an fact frame, the second frame may be an Vue frame, and the attributes and attribute values of the fact frame may be classified by attribute name and attribute value and converted into attributes and attribute values that may be used in the Vue frame, resulting in attributes and attribute values required by the Vue frame. Reference numerals 106, 107, and 108 show attributes and attribute values required for the second frame, wherein reference numeral 108 shows, including a preset category attribute 3 shown by reference numeral 109 and an attribute value 3 of a preset category shown by reference numeral 110. The reference numerals 106, 107 and 109, attribute 1 required by the second frame and attribute value 1 required by the second frame, attribute 2 required by the second frame and attribute value 2 required by the second frame and attribute 3 of the preset category, may be instantiated by an instance generating component of the second frame, such as an Vue frame click event instance generating component, to obtain a second frame instance shown by reference numeral 112, the second frame instance may be an Vue instance, and attribute 3 of the preset category may be an attribute 3 of the first frame after classification and processing. The attribute 3 of the first frame may be a ref attribute of the fact frame. The attribute value 3 of the preset category indicated by reference numeral 110 is mounted to the position indicated by reference numeral 111 of the second frame example indicated by reference numeral 112, wherein the position indicated by reference numeral 111 is the attribute value 3 of the preset category indicated by reference numeral 109, which is indicated in the second frame example. The attribute value 3 of the preset category may be the classified and processed attribute value 3 of the first frame.
It is understood that the method of data processing may be performed by the computing device 101 described above. The computing device 101 may be hardware or software. When computing device 101 is hardware, it may be a variety of computing devices with information processing capabilities including, but not limited to, smart phones, tablets, e-book readers, laptop portable computers, desktop computers, servers, and the like. When the computing device 101 is software, it can be installed in the computing devices listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in FIG. 1 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 2, a flow 200 of some embodiments of a method of data processing in accordance with the present disclosure is shown. The data processing method comprises the following steps:
step 201, processing the received attribute and attribute value of the first frame to obtain the attribute and attribute value required by the second frame.
In some embodiments, the execution subject of the method of data processing may be a server. The first frame is a front end frame. As an example, the first frame may be a reach frame. The React frame is a JAVASCRIPT library used for constructing a user interface and is mainly used for constructing the user interface. Under the React frame, the attribute of the first frame may be state. The state is an important attribute in the component object, and the component rendering can be resumed by updating the attribute value of the state of the component. Wherein the components have their own properties and methods, the components are simple encapsulations of data and methods. The attribute value of the first frame may be an object, and the object may be target data with an external specific interface obtained after the independent function module or the processing unit module is packaged. The property of the first frame may also be refs, which may be used to represent an element within the component, and the property value of the first frame may be an element within the component.
In some embodiments, the second frame is also a front end frame. By way of example, the second frame may be an Vue frame, and the Vue frame is a set of progressive frames used to construct the user interface. The received attribute and attribute name of the first frame may be subjected to category processing and data format and data type processing, resulting in Vue attribute and attribute values required by the frame that may be used in the Vue frame.
In some optional implementations of some embodiments, the received attribute and attribute value of the first frame are passed into the first component, so that the first component classifies and transforms the attribute and attribute value to obtain the attribute and attribute value required by the second frame. The first component is a component of the front-end framework, and can process the received attribute and attribute value of the first framework. By way of example, the component in the first frame may be used to implement a function of recording the number of times a button is clicked, and further, the component in the React frame may be used to implement a function of real-time refreshing of data.
In some optional implementations of some embodiments, as an example, the received attribute and attribute value of the first framework may be passed into the first component, so that the first component classifies and transforms the attribute and attribute value. The classification processing may be performed according to the attribute name, or may be performed according to the attribute value. The conversion process may be to convert the attributes and attribute values of the first frame into the attributes and attribute values that can be used in the second frame, which are required by the second frame.
Step 202, generating a second frame instance based on the attributes and attribute values required by the second frame.
In some embodiments, the attributes and attribute values required by the second framework may be passed into the second framework, instantiated, and generated instances of the second framework.
In some optional implementations of some embodiments, the attributes and attribute values that the second framework can use are passed into the second component, so that the second component generates a second framework instance. The second component may be a component for implementing a function of recording the number of times a button is clicked and implementing a data mount function. By way of example, the second component may be a click button component in the Vue framework that implements the record button number of clicks function.
Step 203, in response to that the attributes required by the second frame include attributes of a preset category, mounting the attribute values corresponding to the attributes of the preset category in the second frame instance.
In some optional implementations of some embodiments, in response to a certain attribute included in the attributes required by the second framework, the certain attribute required by the second framework may be passed into a component of the second framework, the component of the second framework being inserted into a specific attribute of the first framework, so that a subsequent third component is inserted into an attribute value of the certain attribute. As an example, the attributes required for the Vue frame may be imported into the components of the Vue frame, the components of the Vue frame being inserted into the ref attribute of fact.
The specific attribute inserted into the first frame by the component of the second frame is a mounting position identifier, and is used for representing the mounting position of the attribute value corresponding to the attribute of the preset category.
In some embodiments, the attributes of the preset categories are attributes of the front end framework. As an example, the attribute of the preset category may be a child attribute required by the second frame, and may also be a slot attribute required by the Vue frame.
Further, the attribute of the preset category may be a child attribute required by an Vue frame, or may be a slot attribute required by a Vue frame.
Wherein the child property represents all child nodes of a component of the framework. The slot attribute has the function of a slot, and other elements can be put into the position represented by the slot attribute.
In some alternative implementations of some embodiments, the third component may be a component of the first frame. The third component may mount the child property value or slot property value to a preset location using the Portal mechanism of the first framework. Further, a component of the React framework uses the Portal mechanism of React to mount a child property value or slot property value to a preset location.
One of the above-described various embodiments of the present disclosure has the following advantageous effects: by performing classification processing and conversion processing on the attributes and attribute values of the first framework, data required for generating the second framework instance can be obtained. The attributes required by the second frame comprise attributes of preset categories, and the attribute values corresponding to the attributes of the preset categories are mounted in the second frame example, so that a complete second frame example can be obtained. The generation of the second framework instance based on the attribute and the attribute value of the first framework is realized, and on the basis, the data interaction between the first framework and the second framework can be realized.
With continued reference to fig. 3, a flow 300 of further embodiments of a method of data processing according to the present disclosure is shown. The data processing method comprises the following steps:
step 301, the received attributes and attribute values of the first frame are transmitted to the first component, so that the first component classifies and converts the attributes and attribute values to obtain the attributes and attribute values required by the second frame.
Step 302, listening for a front-end event.
In some embodiments, the front-end event is an event executed at a web page front-end or an application software front-end. By way of example, this may be a click event on a web page or mobile application, or a drop-down text box event. The stream of events generated by these events can be captured and analyzed to enable interception.
Step 303, in response to the listening result, the target mechanism is triggered.
In some embodiments, the listening result may be the same event as the preset event.
In some embodiments, the target mechanism is a mechanism to update the first component, the second component, or the third component described above. The above components may be updated entirely or partially.
In some alternative implementations of some embodiments, the target mechanism may be a callback function mechanism that updates the first component, the second component, and the third component. As an example, the first component, the second component, and the third component may all be deleted and then the first component, the second component, and the third component may be regenerated. Or may be a reference mechanism that updates the second component described above. By way of example, part of the content of the second component may be changed, or a reference to the second component may be used directly, the reference itself may be pointed unchanged, and the value in the reference may be changed, thereby implementing the update.
Step 304, generating a second frame instance based on the attributes and attribute values required by the second frame.
Step 305, in response to that the attributes required by the second frame include attributes of a preset category, mounting an attribute value corresponding to the attribute of the preset category in the second frame instance.
In some embodiments, specific implementation of steps 301, 304, and 305 and technical effects brought by the implementation may refer to steps 201, 202, and 203 in the embodiment corresponding to fig. 2, and are not described herein again.
The data processing method disclosed by some embodiments of the disclosure can realize monitoring of events and trigger a target mechanism in response to a monitoring result, thereby realizing component update. Based on the callback function mechanism and the reference mechanism, the updating of the component can be realized, and the generated instance of the component is changed on the basis of the updating of the component. Based on the change of the above example, the front-end effect is also changed correspondingly, so as to obtain the effect different from the original data interaction result.
With further reference to fig. 4, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a data processing apparatus, which correspond to those of the method embodiments shown in fig. 2, and which may be applied in particular in various electronic devices.
As shown in fig. 4, the data processing apparatus 400 of some embodiments includes: a data processing unit 401, an instance generation unit 402, and a data mount unit 403. The data processing unit 401 is configured to process the received attribute and attribute value of the first frame to obtain an attribute and attribute value required by the second frame; an instance generating unit 402 configured to generate a second frame instance based on the attribute and the attribute value required by the second frame; the data mounting unit 403 is configured to mount, in response to the attribute required by the second frame including the attribute of the preset category, an attribute value corresponding to the attribute of the preset category into the second frame instance.
In an optional implementation of some embodiments, the data processing unit 401 is further configured to: and transmitting the received attributes and attribute values of the first frame into the first component, so that the first component classifies and converts the attributes and attribute values to obtain the attributes and attribute values required by the second frame.
In an optional implementation of some embodiments, the instance generating unit 402 is further configured to: and instantiating the attribute and the attribute value required by the second frame to generate an instance of the second frame.
In an optional implementation manner of some embodiments, the data mounting unit 403 is further configured to: and in response to the attribute required by the second frame including the attribute of the preset category, transmitting the attribute required by the second frame into a second component, so that the second component generates a second frame instance with a mounting position identifier, wherein the mounting position identifier is used for representing a mounting position of an attribute value corresponding to the attribute of the preset category.
In an optional implementation manner of some embodiments, the data mounting unit 403 is further configured to: and transmitting the attribute value corresponding to the attribute of the preset category into a third component, so that the third component mounts the attribute value corresponding to the attribute of the preset category into a second frame instance.
In an optional implementation manner of some embodiments, the apparatus further includes: an event monitoring unit configured to monitor a front-end event; a mechanism triggering unit configured to trigger the target mechanism in response to the listening result.
In an alternative implementation of some embodiments, the target mechanism includes: a callback function mechanism for updating said first component, said second component and said third component, or a reference mechanism for updating said second component.
In an optional implementation of some embodiments, the data processing unit 401 is further configured to: and transmitting the received attributes and attribute values of the first frame into the first component, so that the first component classifies and converts the attributes and attribute values to obtain the attributes and attribute values required by the second frame.
In an optional implementation manner of some embodiments, the data mounting unit 403 is further configured to: and in response to that the attributes required by the second frame include attributes of a preset category, the third component mounts the attribute value corresponding to the attribute of the preset category to the mounting position identified by the mounting position identifier in the second frame instance.
It will be understood that the elements described in the apparatus 400 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 400 and the units included therein, and will not be described herein again.
As shown in fig. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 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. Each block shown in fig. 5 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program, when executed by the processing device 501, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may 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 some embodiments of the 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 some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, 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: processing the received attributes and attribute values of the first frame to obtain attributes and attribute values required by a second frame; generating a second frame instance based on the attributes and attribute values required by the second frame; and in response to the fact that the attributes required by the second frame comprise the attributes of the preset category, mounting the attribute values corresponding to the attributes of the preset category into the second frame instance.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including 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 some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a data processing unit, an instance generation unit, and a data mounting unit. The names of these units do not in some cases constitute a limitation on the units themselves, and for example, a data processing unit may also be described as a "unit that processes data".
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.
According to one or more embodiments of the present disclosure, there is provided a method of data processing, including: processing the received attributes and attribute values of the first frame to obtain attributes and attribute values required by a second frame; generating a second frame instance based on the attributes and attribute values required by the second frame; and in response to the fact that the attributes required by the second frame comprise the attributes of the preset category, mounting the attribute values corresponding to the attributes of the preset category into the second frame instance.
According to one or more embodiments of the present disclosure, processing the received attributes and attribute values of the first frame to obtain attributes and attribute values required by the second frame includes: and transmitting the received attributes and attribute values of the first frame into the first component, so that the first component classifies and converts the attributes and attribute values to obtain the attributes and attribute values required by the second frame.
According to one or more embodiments of the present disclosure, the generating a second framework instance based on the attributes and attribute values required by the second framework includes: and instantiating the attribute and the attribute value required by the second frame to generate an instance of the second frame.
According to one or more embodiments of the present disclosure, the instantiating the attribute and the attribute value required by the second framework to generate the instance of the second framework includes: and in response to the attribute required by the second frame including the attribute of the preset category, transmitting the attribute required by the second frame into a third component, so that the second component generates a second frame instance with a mounting position identifier, wherein the mounting position identifier is used for representing a mounting position of an attribute value corresponding to the attribute of the preset category.
According to one or more embodiments of the present disclosure, the mounting, in response to that the attribute required by the second frame includes the attribute of the preset category, an attribute value corresponding to the attribute of the preset category to the second frame instance includes: and transmitting the attribute of the preset category into a third component, so that the third component mounts the attribute value corresponding to the attribute of the preset category into a second frame instance.
According to one or more embodiments of the present disclosure, before generating the second framework instance based on the attributes and attribute values required by the second framework, the method further includes: monitoring a front-end event; in response to the snoop result, the target mechanism is triggered.
According to one or more embodiments of the present disclosure, the target mechanism includes: a callback function mechanism for updating said first component, said second component and said third component, or a reference mechanism for updating said second component.
According to one or more embodiments of the present disclosure, the above responding to that the attribute required by the second frame includes an attribute of a preset category, and importing the attribute of the preset category into the third component, so that the third component mounts an attribute value corresponding to the attribute of the preset category into the second frame instance, includes: and in response to that the attributes required by the second frame include attributes of a preset category, the third component mounts the attribute value corresponding to the attribute of the preset category to the mounting position identified by the mounting position identifier in the second frame instance.
According to one or more embodiments of the present disclosure, there is provided a data processing apparatus including: the data processing unit is configured to process the received attributes and attribute values of the first frame to obtain attributes and attribute values required by the second frame; an instance generating unit configured to generate a second frame instance based on the attribute and the attribute value required by the second frame; and the data mounting unit is configured to respond to the attribute required by the second frame and comprise the attribute of the preset category, and mount the attribute value corresponding to the attribute of the preset category into the second frame instance.
According to one or more embodiments of the present disclosure, the data processing unit is further configured to: and transmitting the received attributes and attribute values of the first frame into the first component, so that the first component classifies and converts the attributes and attribute values to obtain the attributes and attribute values required by the second frame.
According to one or more embodiments of the present disclosure, the above-mentioned instance generating unit is further configured to: and instantiating the attribute and the attribute value required by the second frame to generate an instance of the second frame.
According to one or more embodiments of the present disclosure, the data mounting unit is further configured to: and in response to the attribute required by the second frame including the attribute of the preset category, transmitting the attribute required by the second frame into a second component so that the second component generates a second frame instance with a mounting position identifier, wherein the mounting position identifier is used for representing a mounting position of an attribute value corresponding to the attribute of the preset category.
According to one or more embodiments of the present disclosure, the data mounting unit is further configured to: and transmitting the attribute of the preset category into a third component, so that the third component mounts the attribute value corresponding to the attribute of the preset category into a second frame instance.
According to one or more embodiments of the present disclosure, the apparatus further includes: an event monitoring unit configured to monitor a front-end event; a mechanism triggering unit configured to trigger the target mechanism in response to the listening result.
According to one or more embodiments of the present disclosure, the data mounting unit is further configured to: and in response to that the attributes required by the second frame include attributes of a preset category, the third component mounts the attribute value corresponding to the attribute of the preset category to the mounting position identified by the mounting position identifier in the second frame instance.
According to one or more embodiments of the present disclosure, there is provided an electronic device including: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as in any above.
According to one or more embodiments of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the method as described in any of the embodiments above.
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 invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.