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 should 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. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such 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 classification and conversion processing shown by reference numeral 105 on 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, respectively, shown by reference numerals 102, 103, and 104. And obtaining the required attributes and attribute values of the second framework. As an example, the first frame may be a real frame, the second frame may be a Vue frame, and the attributes and attribute values of the real frame may be classified according to attribute names and attribute values and converted into attributes and attribute values that may be used in the Vue frame, to obtain the attributes and attribute values required by the Vue frame. Reference numerals 106, 107, and 108 denote the attributes and attribute values required for the second framework, wherein reference numeral 108 denotes a preset category attribute 3 denoted by reference numeral 109, and a preset category attribute value 3 denoted by reference numeral 110. The second frame instance shown by reference numeral 112 may be obtained by instantiating, by an instance generating component of the second frame, such as a Vue frame click event instance generating component, the reference numerals 106, 107 and 109, the attribute 1 required by the second frame, the attribute value 1 required by the second frame, the attribute 2 required by the second frame, the attribute value 2 required by the second frame and the attribute 3 of the preset category, where the second frame instance may be a Vue instance, and the attribute 3 of the preset category may be the attribute 3 of the first frame after being classified and processed. Wherein, the attribute 3 of the first frame may be a ref attribute of the exact frame. The attribute value 3 of the preset category shown by reference numeral 110 is mounted to the position shown by reference numeral 111 of the second frame example shown by reference numeral 112, wherein the position shown by reference numeral 111 is the attribute value 3 of the preset category shown by reference numeral 109, and the position shown in the second frame example. The attribute value 3 of the preset category may be the attribute value 3 of the classified and processed first frame.
It will be appreciated 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 having information processing capabilities, including but not limited to smartphones, tablets, electronic book readers, laptop computers, desktop computers, servers, and the like. When the computing device 101 is software, it may be installed in the computing devices listed above. It may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention 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 desired for an implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a method of data processing according to the present disclosure is shown. The data processing method comprises the following steps:
and 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 body 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 React frame. The act framework is a JAVASCRIPT library for building user interfaces, mainly for building user interfaces. Under the act framework, the property of the first framework may be state. state is an important attribute in the component object, and component rendering can be performed again by updating the attribute value of the state of the component. Wherein the components have their own properties and methods, and the components are simple packages of data and methods. The attribute value of the first frame may be an object, and the object may be an independent functional module or a processing unit module, and after being packaged, the obtained target data with an external specific interface. The attribute of the first framework may also be refs, refs may be used to represent an element within the component, and the attribute value of the first framework may be an element within the component.
In some embodiments, the second frame is also a front end frame. As an example, the second frame may be a Vue frame, which is a set of progressive frames used to build the user interface. And processing the received attribute and attribute name of the first frame by category processing, data format and data type to obtain the required attribute and attribute value in the Vue frame.
In some alternative implementations of some embodiments, the received attributes and attribute values of the first framework are passed to the first component, so that the first component classifies and translates the attributes and attribute values to obtain the attributes and attribute values required by the second framework. The first component is a component of the front-end framework, and can process the attribute and the attribute value of the received first framework. As an example, the component for realizing the function of recording the number of times the button is clicked in the first frame may be a component for realizing the data real-time refresh function in the exact frame.
In some alternative implementations of some embodiments, as an example, the received attribute and attribute value of the first frame may be passed into the first component, such that the first component classifies and translates the attribute and attribute value. The classification processing may be performed according to attribute names, or may be performed according to attribute values. The conversion process may be to convert the attribute and attribute value of the first frame described above into an attribute and attribute value that may be used in the second frame required for the second frame.
Step 202, generating a second frame instance based on the required attribute and the attribute value of the second frame.
In some embodiments, the attributes and attribute values required by the second framework may be passed into the second framework, and the attributes and attribute values required by the second framework may be instantiated to generate an instance of the second framework.
In some optional implementations of some embodiments, the attributes and attribute values that may be used by the second framework are passed into a second component to cause the second component to generate a second framework instance. The second component may be a component for implementing a function of recording the number of times the button is clicked and implementing a data mounting function. As an example, the second component may be a click button component in the Vue framework to implement a record button number of clicks function.
And 203, mounting an attribute value corresponding to the attribute of the preset category into the second frame instance in response to the attribute required by the second frame including the attribute of the preset category.
In some alternative implementations of some embodiments, in response to including a property in the second frame desired properties, the property desired by the second frame may be passed into a component of the second frame, the component of the second frame inserting a particular property of the first frame, such that a subsequent third component inserts a property value of the property. As an example, properties required by the Vue frame may be passed into components of the Vue frame, which insert ref properties of the reaction.
The specific attribute of the component of the second frame inserted into the first frame is a mounting position identifier, which is used for representing the mounting position of the attribute value corresponding to the attribute of the preset category.
In some embodiments, the attribute of the preset category is an attribute of the front end framework. As an example, the attribute of the preset category may be a child attribute required for the second frame, or may be a slot attribute required for the Vue frame.
Further, the attribute of the preset category may be the child attribute required by the Vue frame, or the slot attribute required by the Vue frame.
Wherein the child attribute 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 in 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 a Portal mechanism of the first framework. Further, a component of the React framework uses the Portal mechanism of React to mount the child property value or slot property value to a preset location.
One of the above embodiments of the present disclosure has the following advantageous effects: by performing classification processing and conversion processing on the attribute and the attribute value of the first frame, data required for generating the second frame instance can be obtained. The attributes required by the second frame comprise attributes of preset categories, and attribute values corresponding to the attributes of the preset categories are mounted in the second frame instance, so that the complete second frame instance can be obtained. The method and the device realize the generation of the second frame instance based on the attribute and the attribute value of the first frame, and can realize the data interaction between the first frame and the second frame on the basis of the generation of the second frame instance.
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 attribute and attribute value of the first frame are transmitted to the first component, so that the first component classifies and converts the attribute and the attribute value to obtain the attribute and the attribute value required by the second frame.
Step 302, monitor the front-end event.
In some embodiments, the front-end event is an event that is executed at the front-end of a web page or application software. As an example, it may be a click event on a web page or mobile application, or a drop down text box event. Event streams generated by these events can be acquired and analyzed to effect listening.
In step 303, a target mechanism is triggered in response to the listening result.
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 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, second, and third components may be all deleted, and then regenerated. A reference mechanism for updating the second component is also possible. As an example, part of the content of the second component may be changed, or the reference of the second component may be directly used, the reference itself is unchanged, and the value in the reference is changed, so as to implement updating.
Step 304, generating a second frame instance based on the required attribute and the attribute value of the second frame.
And step 305, in response to the attribute required by the second frame including the attribute of the preset category, mounting the attribute value corresponding to the attribute of the preset category into the second frame instance.
In some embodiments, the specific implementation of steps 301, 304 and 305 and the technical effects thereof may refer to steps 201, 202 and 203 in the corresponding embodiment of fig. 2, which are not described herein.
The data processing method disclosed by some embodiments of the present disclosure can realize monitoring of events and trigger a target mechanism in response to the monitoring result, thereby realizing component update. Based on the callback function mechanism and the reference mechanism, the component can be updated, and the instance generated by the component is changed on the basis of the component update. Based on the changes of the examples, the front-end effect can be correspondingly changed, so that an effect different from the original data interaction result is obtained.
With further reference to fig. 4, as an implementation of the method shown in the above figures, the present disclosure provides some embodiments of a data processing apparatus, which correspond to those method embodiments shown in fig. 2, and which are particularly applicable 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 generating unit 402, and a data mounting 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 an attribute value required by the second frame; an instance generation unit 402 configured to generate a second frame instance based on the attribute and the attribute value required for the second frame; and a data mounting unit 403 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 alternative implementation of some embodiments, the above-mentioned data processing unit 401 is further configured to: and transmitting the received attribute and attribute value of the first frame into the first component so that the first component classifies and converts the attribute and the attribute value to obtain the attribute and the attribute value required by the second frame.
In an alternative implementation of some embodiments, the above-described instance generation unit 402 is further configured to: and instantiating the attributes and the attribute values required by the second framework to generate an instance of the second framework.
In an alternative implementation of some embodiments, the data mounting unit 403 is further configured to: and transmitting the attribute required by the second frame into a second component in response to the attribute required by the second frame comprising the attribute of the preset category, so that the second component generates a second frame instance with a mounting position identifier, wherein the mounting position identifier is used for representing the mounting position of the attribute value corresponding to the attribute of the preset category.
In an alternative implementation 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 alternative implementation of some embodiments, the apparatus further includes: an event monitoring unit configured to monitor a front-end event; and a mechanism triggering unit configured to trigger the target mechanism in response to the listening result.
In alternative implementations of some embodiments, the target mechanism includes: a callback function mechanism for updating the first component, the second component, and the third component, or a reference mechanism for updating the second component.
In an alternative implementation of some embodiments, the above-mentioned data processing unit 401 is further configured to: and transmitting the received attribute and attribute value of the first frame into the first component so that the first component classifies and converts the attribute and the attribute value to obtain the attribute and the attribute value required by the second frame.
In an alternative implementation 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, the third component mounts the attribute value corresponding to the attribute of the preset category to the mounting position identified by the mounting position identification in the second frame instance.
It will be appreciated that the elements described in the apparatus 400 correspond to the various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting benefits described above with respect to the method are equally applicable to the apparatus 400 and the units contained therein, and are not described in detail herein.
As shown in fig. 5, the electronic device 500 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to 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 required 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 via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 508 including, for example, magnetic tape, hard disk, etc.; and communication means 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 shows an electronic device 500 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 5 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts 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 shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communications device 509, or from the storage device 508, or from the ROM 502. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing device 501.
It should be noted that the computer readable medium according to 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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 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 some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, 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 communication 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 networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated 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 attribute and attribute value of the first frame to obtain the attribute and attribute value required by the second frame; generating a second frame instance based on the required attribute and the required attribute value of the second frame; and responding to the attribute required by the second frame to comprise the attribute of the preset category, and mounting the attribute value corresponding to the attribute of the preset category into the second frame instance.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts 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 means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, 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 constitute a limitation on the unit itself in some cases, and for example, a data processing unit may also be described as "a unit that processes data".
The functions described above herein 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: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
According to one or more embodiments of the present disclosure, there is provided a method of data processing, comprising: processing the received attribute and attribute value of the first frame to obtain the attribute and attribute value required by the second frame; generating a second frame instance based on the required attribute and the required attribute value of the second frame; and responding to the attribute required by the second frame to comprise the attribute of the preset category, and mounting 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, processing the received attribute and attribute value of the first frame to obtain the attribute and attribute value required by the second frame includes: and transmitting the received attribute and attribute value of the first frame into the first component so that the first component classifies and converts the attribute and the attribute value to obtain the attribute and the attribute value required by the second frame.
According to one or more embodiments of the present disclosure, the generating a second frame instance based on the attribute and the attribute value required by the second frame includes: and instantiating the attributes and the attribute values required by the second framework to generate an instance of the second framework.
According to one or more embodiments of the present disclosure, the foregoing instantiating the attribute and the attribute value required by the second framework, generating an instance of the second framework includes: and transmitting the attribute required by the second frame into a third component in response to the attribute required by the second frame comprising the attribute of the preset category, so that the second component generates a second frame instance with a mounting position identifier, wherein the mounting position identifier is used for representing the mounting position of the attribute value corresponding to the attribute of the preset category.
According to one or more embodiments of the present disclosure, the responding to the attribute required by the second frame including the attribute of the preset category, mounting the 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 example.
In accordance with one or more embodiments of the present disclosure, before generating the second frame instance based on the required attributes and attribute values of the second frame, the method further comprises: monitoring a front-end event; and triggering a target mechanism in response to the monitoring result.
According to one or more embodiments of the present disclosure, the above-described objective mechanism includes: a callback function mechanism for updating the first component, the second component, and the third component, or a reference mechanism for updating the second component.
According to one or more embodiments of the present disclosure, the responding to the attribute required by the second frame including the attribute of the preset category, transmitting the attribute of the preset category to the third component, so that the third component mounts the attribute value corresponding to the attribute of the preset category into the second frame instance, includes: and in response to the attribute required by the second frame including the attribute of the 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 identification 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 attribute and attribute value of the first frame to obtain the attribute and attribute value required by the second frame; an instance generation 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 mount an attribute value corresponding to the attribute of the preset category into the second frame instance in response to the attribute of the preset category included in the attributes required by the second frame.
According to one or more embodiments of the present disclosure, the above-described data processing unit is further configured to: and transmitting the received attribute and attribute value of the first frame into the first component so that the first component classifies and converts the attribute and the attribute value to obtain the attribute and the attribute value required by the second frame.
According to one or more embodiments of the present disclosure, the above-described instance generating unit is further configured to: and instantiating the attributes and the attribute values required by the second framework to generate an instance of the second framework.
According to one or more embodiments of the present disclosure, the above-described data mounting unit is further configured to: and transmitting the attribute required by the second frame into a second component in response to the attribute required by the second frame comprising the attribute of the preset category, so that the second component generates a second frame instance with a mounting position identifier, wherein the mounting position identifier is used for representing the mounting position of the attribute value corresponding to the attribute of the preset category.
According to one or more embodiments of the present disclosure, the above-described 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 example.
According to one or more embodiments of the present disclosure, the above-described apparatus further includes: an event monitoring unit configured to monitor a front-end event; and 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 above-described 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, the third component mounts the attribute value corresponding to the attribute of the preset category to the mounting position identified by the mounting position identification 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; and a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement a method as described above.
According to one or more embodiments of the present disclosure, there is provided a computer readable medium having stored thereon a computer program, wherein the program, when executed by a processor, implements a method as described in any of the embodiments above.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being 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 technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.