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 of one application scenario of a device adaptation method according to some embodiments of the present disclosure.
In the application scenario shown in fig. 1, first, the computing device 101 may sequentially execute each statement in the pre-established chain statement 102, resulting in the execution result 103 of the chain statement 102. In the application scenario, the content of the chained statement is "oPhone (7,4.5) oPhone11 (10, 6) oPhone12 (12, 8)", and the page parameter information corresponding to the device with the attribute information "oPhone" is the page length: 7cm, page width: 4.5cm. The page parameter information corresponding to the device with the attribute information of "opphone 11" is the page length: 10cm, page width: 6cm. The page parameter information corresponding to the device with the attribute information of "opphone 12" is the page length: 12cm, page width: 8cm. And, the attribute information of the device in the present application scenario is "opphone", and thus, the corresponding execution result is "7,4.5". Then, based on the execution result 103 of the chained statement 102, page parameter information 105 of the page 104 to be displayed on the device is determined. In the present application scenario, the page parameter is "page length: and finally, displaying the page 104 to be displayed based on the page parameter information 105, wherein the page width is 7cm and the page width is 4.5cm ".
It is understood that the device adaptation method may be performed by the terminal device 101, or may be performed by a server, and the execution subject of the method may further include a device formed by integrating the terminal device 101 and the server through a network, or may be performed by various software programs. Among other things, the terminal device 101 may be various electronic devices with information processing capabilities, including but not limited to smartphones, tablets, electronic book readers, laptop and desktop computers, and the like. The execution body may be embodied as a server, software, or the like. When the execution subject is software, the execution subject can be installed in the electronic device enumerated 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 terminal devices in fig. 1 is merely illustrative. There may be any number of terminal devices, as desired for implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a device adaptation method according to the present disclosure is shown. The equipment adaptation method comprises the following steps:
Step 201, executing each sentence in the pre-established chain sentences in turn to obtain the execution result of the chain sentences.
In some embodiments, a first sentence in the sentences is used for constructing an object of a target type, and at least one sentence after the first sentence in the sentences is used for acquiring attribute information of the device and generating an intermediate execution result based on the attribute information.
In some embodiments, the execution result of the previous one of the two sub-statements in the chain statement may call the subsequent sub-statement.
In some embodiments, the chain grammar statement currently executed may be a statement in any programming language, such as C (Combined Programming Language, composite design language), objective-C (Objective Combined Programming Language, object-oriented composite design language), and the like, as desired. And, according to the actual needs, the structures of the sentences may also be different for the sentences of the same programming language.
Step 202, determining page parameter information of a page to be displayed on the device based on the execution result of the chained statement.
In some embodiments, the page parameter information may be any information that may characterize the page presentation size. The page parameters described above may include, as examples: the display length of the page and the display width of the page. As yet another example, the above page parameter information may further include: the display area of the page and the display aspect ratio of the page. As yet another example, the above page parameter information may further include: the display length of the page and the display aspect ratio of the page.
In some embodiments, the page parameter information may also be the font and size of the characters in the page. As an example, the above page parameter information may be "regular script", "No. 14".
In some embodiments, the execution body of the device adaptation method may perform data type conversion on the execution result, where the conversion result is used as a page parameter to obtain the page parameter information.
In some embodiments, the execution body may further determine the execution result as the page parameter to obtain the page parameter information on the basis that the execution result is the target data type.
And 203, displaying the page to be displayed based on the page parameter information.
In some embodiments, the execution body may first scale the page to be displayed according to the page parameter information to obtain a standard size page to be displayed. And then, displaying the page to be displayed with the standard size at the target position of the target interface.
In some embodiments, the execution body may cut the page to be displayed according to the page parameter information to obtain a standard size page to be displayed. And then, displaying the page to be displayed with the standard size at the target position of the target interface.
The method provided by some embodiments of the present disclosure realizes compact multi-device adaptation engineering by using chained sentences, so that engineers can perform multi-device adaptation more conveniently and easily.
With further reference to fig. 3, a flow 300 of further embodiments of a device adaptation method is shown. The process 300 of the device adaptation method comprises the steps of:
step 301, determining preset parameters of a first sentence in the pre-established chain sentences as input parameters of a construction method.
In some embodiments, the above construction method is used to encapsulate input parameters into objects of the target type.
In some embodiments, the execution body may directly transmit the preset parameters of the first sentence to the construction method as input parameters thereof.
In some embodiments, the execution body may further transmit, to the construction method, a storage address of a preset parameter of the first sentence in the target storage space as an input parameter thereof.
Step 302, encapsulating the input parameters of the construction method into the object of the target type.
In some embodiments, the execution body of the device adaptation method may encapsulate the input parameters of the above construction method into the object of the above target type using a method of forced type conversion.
In some embodiments, the execution body may also first create an object of a target type. And then, assigning the target member of the object as the data represented by the input parameter.
And step 303, determining the object of the target type as an execution result of the first sentence.
Step 304, calling the current execution statement by using the execution result of the previous statement of the current execution statement.
In some embodiments, the execution result of the previous statement of the current execution statement is an object of the target type. And an instance method in which the current execution statement is an object of the target type. On this basis, the execution body may call the current execution sentence using the execution result of the previous sentence of the current execution sentence.
Step 305, determining preset parameters of the current execution statement as input parameters of the example method corresponding to the current execution statement.
In some embodiments, the execution body may directly transmit the preset parameters of the current execution statement to the instance method corresponding to the current execution statement as the input parameters thereof.
In some embodiments, the execution body may further transmit a storage address of the preset parameter of the current execution statement in the target storage space to an instance method corresponding to the current execution statement as an input parameter thereof.
Step 306, obtaining attribute information of the device.
In some embodiments, the executing entity may obtain the attribute information of the device through an operating system interface provided by the device.
In some embodiments, the attribute information may be a numerical value or a character string including a device model parameter.
Step 307, in response to determining that the device type represented by the attribute information is consistent with the device type corresponding to the current execution statement, packaging the input parameters of the instance method corresponding to the current execution statement as an object of a target type, and obtaining an execution result of the current execution statement.
In some embodiments, the execution body may use a method of forced type conversion to encapsulate an input parameter of an instance method corresponding to the current execution statement into the object of the target type.
In some embodiments, the execution body may also first create an object of a target type. And then, assigning the target member of the object as the data of the input parameter characterization of the instance method corresponding to the current execution statement.
Step 308, in response to determining that the device types represented by the attribute information are inconsistent with the device types corresponding to the current execution statement, determining the execution result of the previous statement as the execution result of the current execution statement.
In some embodiments, the device type corresponding to the current execution statement may be determined by a name of the execution statement. For example, the name of the currently executed statement is "ophon 12", and the device type corresponding thereto is characterized as "ophon 12".
Step 309, in response to determining that the current execution statement is the last statement in the chain statements, determining the execution result of the current execution statement as the execution result of the chain statements.
Step 310, determining page parameter information of the page to be displayed on the device based on the execution result of the chained statement.
Step 311, based on the page parameter information, displaying the page to be displayed.
In some embodiments, the specific implementation of steps 310-311 and the technical effects thereof may refer to steps 202-203 in the corresponding embodiment of fig. 2, which are not described herein.
As can be seen from fig. 3, in some embodiments corresponding to fig. 3, the disadvantage of requiring the user to create an object is avoided by invoking the corresponding construction method using the first statement in the chained statement, as compared to the description of some embodiments corresponding to fig. 2. The user experience is improved. When the equipment type represented by the attribute information is inconsistent with the equipment type corresponding to the current execution statement, determining the execution result of the previous statement of the current execution statement as the execution result of the current execution statement, and taking the preset parameter of the first statement as the default page parameter information when the equipment type represented by the attribute information does not meet each statement in the chained statement. That is, the user can adjust default page parameter information by configuring preset parameters of the first sentence.
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 device adaptation apparatus, which apparatus embodiments correspond to those method embodiments shown in fig. 2, which apparatus is particularly applicable in various electronic devices.
As shown in fig. 4, the device adaptation apparatus 400 of some embodiments includes: execution unit 401, determination unit 402, presentation unit 403. The execution unit 401 is configured to sequentially execute each sentence in the pre-established chain sentences to obtain an execution result of the chain sentences, wherein a first sentence in the each sentence is used for constructing an object of a target type, and at least one sentence after the first sentence in the each sentence is used for acquiring attribute information of equipment and generating an intermediate execution result based on the attribute information; a determining unit 402 configured to determine page parameter information of a page to be displayed on the device based on an execution result of the chain sentence; and a display unit 403 configured to display the page to be displayed based on the page parameter information.
In alternative implementations of some embodiments, each statement corresponds to a construction method and an instance method, where the construction method is used to encapsulate the input parameters into the object of the target type; and the execution unit 401 is further configured to: executing a construction method corresponding to a first sentence in the chain type sentences to obtain an execution result of the first sentence; and sequentially executing the example methods corresponding to each sentence in at least one sentence after the first sentence based on the execution result of the first sentence to obtain the execution result of the chained sentence.
In an alternative implementation of some embodiments, the execution unit 401 is further configured to: determining preset parameters of the first sentence as input parameters of the construction method; packaging the input parameters of the construction method into the object of the target type; determining the object of the target type as an execution result of the first sentence; and sequentially executing the example methods corresponding to each sentence in at least one sentence after the first sentence based on the execution result of the first sentence to obtain the execution result of the chained sentence.
In alternative implementations of some embodiments, each statement corresponds to a device type; and the execution unit 401 is further configured to: executing a construction method corresponding to a first sentence in the chain type sentences to obtain an execution result of the first sentence; calling the current execution statement by using the execution result of the previous statement of the current execution statement; determining preset parameters of a current execution statement as input parameters of an example method corresponding to the current execution statement; acquiring attribute information of the equipment; and in response to determining that the equipment type represented by the attribute information is consistent with the equipment type corresponding to the current execution statement, packaging the input parameters of the instance method corresponding to the current execution statement as an object of a target type, and obtaining an execution result of the current execution statement.
In an alternative implementation of some embodiments, the execution unit 401 is further configured to: executing a construction method corresponding to a first sentence in the chain type sentences to obtain an execution result of the first sentence; calling the current execution statement by using the execution result of the previous statement of the current execution statement; determining preset parameters of a current execution statement as input parameters of an example method corresponding to the current execution statement; acquiring attribute information of the equipment; responding to the fact that the equipment type represented by the attribute information is consistent with the equipment type corresponding to the current execution statement, and packaging the input parameters of the instance method corresponding to the current execution statement as objects of a target type to obtain an execution result of the current execution statement; and in response to the fact that the device types represented by the attribute information are inconsistent with the device types corresponding to the current execution statement, determining the execution result of the previous statement as the execution result of the current execution statement.
In an alternative implementation of some embodiments, the execution unit 401 is further configured to: executing a construction method corresponding to a first sentence in the chain type sentences to obtain an execution result of the first sentence; calling the current execution statement by using the execution result of the previous statement of the current execution statement; determining preset parameters of a current execution statement as input parameters of an example method corresponding to the current execution statement; acquiring attribute information of the equipment; responding to the fact that the equipment type represented by the attribute information is consistent with the equipment type corresponding to the current execution statement, and packaging the input parameters of the instance method corresponding to the current execution statement as objects of a target type to obtain an execution result of the current execution statement; in response to determining that the equipment types represented by the attribute information are inconsistent with the equipment types corresponding to the current execution statement, determining the execution result of the previous statement as the execution result of the current execution statement; and in response to determining that the current execution statement is the last statement in the chain statements, determining an execution result of the current execution statement as an execution result of the chain statements.
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.
Referring now to FIG. 5, a schematic diagram of an electronic device (e.g., the computing device of FIG. 1) 500 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), car terminals (e.g., car navigation terminals), and the like, as well as stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
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: sequentially executing each sentence in the pre-established chain sentences to obtain an execution result of the chain sentences, wherein a first sentence in the each sentence is used for constructing an object of a target type, and at least one sentence after the first sentence in the each sentence is used for acquiring attribute information of equipment and generating an intermediate execution result based on the attribute information; determining page parameter information of a page to be displayed on the equipment based on an execution result of the chained statement; and displaying the page to be displayed based on the page parameter information.
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 an execution unit, a determination unit, a presentation unit. The names of these units do not in any way constitute a limitation on the unit itself, for example, a presentation unit may also be described as "a unit presenting a page to be presented".
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 device adaptation method comprising: sequentially executing each sentence in the pre-established chain sentences to obtain an execution result of the chain sentences, wherein a first sentence in the each sentence is used for constructing an object of a target type, and at least one sentence after the first sentence in the each sentence is used for acquiring attribute information of equipment and generating an intermediate execution result based on the attribute information; determining page parameter information of a page to be displayed on the equipment based on an execution result of the chained statement; and displaying the page to be displayed based on the page parameter information.
According to one or more embodiments of the present disclosure, each sentence corresponds to a construction method and an example method, the construction method being used to encapsulate an input parameter into an object of the above-mentioned target type; and sequentially executing each statement in the pre-established chain statement to obtain an execution result of the chain statement, wherein the execution result comprises the following steps: executing a construction method corresponding to a first sentence in the chain type sentences to obtain an execution result of the first sentence; and sequentially executing the example methods corresponding to each sentence in at least one sentence after the first sentence based on the execution result of the first sentence to obtain the execution result of the chained sentence.
According to one or more embodiments of the present disclosure, executing a construction method corresponding to a first sentence in the chained sentences to obtain an execution result of the first sentence includes: determining preset parameters of the first sentence as input parameters of the construction method; packaging the input parameters of the construction method into the object of the target type; and determining the object of the target type as an execution result of the first statement.
According to one or more embodiments of the present disclosure, each statement corresponds to a device type; and the example method for sequentially executing the corresponding sentences in the at least one sentence to obtain the execution result of the chained sentences, which comprises the following steps: calling the current execution statement by using the execution result of the previous statement of the current execution statement; determining preset parameters of a current execution statement as input parameters of an example method corresponding to the current execution statement; acquiring attribute information of the equipment; and in response to determining that the equipment type represented by the attribute information is consistent with the equipment type corresponding to the current execution statement, packaging the input parameters of the instance method corresponding to the current execution statement as an object of a target type, and obtaining an execution result of the current execution statement.
According to one or more embodiments of the present disclosure, an example method corresponding to each statement in the at least one statement is sequentially executed to obtain an execution result of the chained statement, and further includes: and in response to the fact that the device types represented by the attribute information are inconsistent with the device types corresponding to the current execution statement, determining the execution result of the previous statement as the execution result of the current execution statement.
According to one or more embodiments of the present disclosure, an example method corresponding to each statement in the at least one statement is sequentially executed to obtain an execution result of the chained statement, and further includes: and in response to determining that the current execution statement is the last statement in the chain statements, determining an execution result of the current execution statement as an execution result of the chain statements.
According to one or more embodiments of the present disclosure, there is provided a device adaptation apparatus comprising: an execution unit configured to sequentially execute each sentence in a pre-established chain sentence to obtain an execution result of the chain sentence, wherein a first sentence in each sentence is used for constructing an object of a target type, and at least one sentence after the first sentence in each sentence is used for acquiring attribute information of equipment and generating an intermediate execution result based on the attribute information; the determining unit is configured to determine page parameter information of a page to be displayed on the equipment based on an execution result of the chained statement; and the display unit is configured to display the page to be displayed based on the page parameter information.
According to one or more embodiments of the present disclosure, each sentence corresponds to a construction method and an example method, the construction method being used to encapsulate an input parameter into an object of the above-mentioned target type; and the execution unit is further configured to: executing a construction method corresponding to a first sentence in the chain type sentences to obtain an execution result of the first sentence; and sequentially executing the example methods corresponding to each sentence in at least one sentence after the first sentence based on the execution result of the first sentence to obtain the execution result of the chained sentence.
According to one or more embodiments of the present disclosure, the execution unit is further configured to: determining preset parameters of the first sentence as input parameters of the construction method; packaging the input parameters of the construction method into the object of the target type; determining the object of the target type as an execution result of the first sentence; and sequentially executing the example methods corresponding to each sentence in at least one sentence after the first sentence based on the execution result of the first sentence to obtain the execution result of the chained sentence.
According to one or more embodiments of the present disclosure, each statement corresponds to a device type; and the execution unit is further configured to: executing a construction method corresponding to a first sentence in the chain type sentences to obtain an execution result of the first sentence; calling the current execution statement by using the execution result of the previous statement of the current execution statement; determining preset parameters of a current execution statement as input parameters of an example method corresponding to the current execution statement; acquiring attribute information of the equipment; and in response to determining that the equipment type represented by the attribute information is consistent with the equipment type corresponding to the current execution statement, packaging the input parameters of the instance method corresponding to the current execution statement as an object of a target type, and obtaining an execution result of the current execution statement.
According to one or more embodiments of the present disclosure, the execution unit is further configured to: executing a construction method corresponding to a first sentence in the chain type sentences to obtain an execution result of the first sentence; calling the current execution statement by using the execution result of the previous statement of the current execution statement; determining preset parameters of a current execution statement as input parameters of an example method corresponding to the current execution statement; acquiring attribute information of the equipment; responding to the fact that the equipment type represented by the attribute information is consistent with the equipment type corresponding to the current execution statement, and packaging the input parameters of the instance method corresponding to the current execution statement as objects of a target type to obtain an execution result of the current execution statement; and in response to the fact that the device types represented by the attribute information are inconsistent with the device types corresponding to the current execution statement, determining the execution result of the previous statement as the execution result of the current execution statement.
According to one or more embodiments of the present disclosure, the execution unit is further configured to: executing a construction method corresponding to a first sentence in the chain type sentences to obtain an execution result of the first sentence; calling the current execution statement by using the execution result of the previous statement of the current execution statement; determining preset parameters of a current execution statement as input parameters of an example method corresponding to the current execution statement; acquiring attribute information of the equipment; responding to the fact that the equipment type represented by the attribute information is consistent with the equipment type corresponding to the current execution statement, and packaging the input parameters of the instance method corresponding to the current execution statement as objects of a target type to obtain an execution result of the current execution statement; in response to determining that the equipment types represented by the attribute information are inconsistent with the equipment types corresponding to the current execution statement, determining the execution result of the previous statement as the execution result of the current execution statement; and in response to determining that the current execution statement is the last statement in the chain statements, determining an execution result of the current execution statement as an execution result of the chain statements.
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, a computer readable medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements a method as described in any of the 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.