CN108920246B - Form draft component sharing method and device, terminal device and readable storage medium - Google Patents

Form draft component sharing method and device, terminal device and readable storage medium Download PDF

Info

Publication number
CN108920246B
CN108920246B CN201810792876.2A CN201810792876A CN108920246B CN 108920246 B CN108920246 B CN 108920246B CN 201810792876 A CN201810792876 A CN 201810792876A CN 108920246 B CN108920246 B CN 108920246B
Authority
CN
China
Prior art keywords
component
draft
form draft
identification
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810792876.2A
Other languages
Chinese (zh)
Other versions
CN108920246A (en
Inventor
彭飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Publication of CN108920246A publication Critical patent/CN108920246A/en
Application granted granted Critical
Publication of CN108920246B publication Critical patent/CN108920246B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/453Help systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Artificial Intelligence (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a form draft component sharing method and device, terminal equipment and a readable storage medium. The method comprises the following steps: receiving a form draft component identification, a component method identification and a form draft parameter transmitted by a service caller, wherein the form draft parameter comprises at least one parameter in standard storage parameters of the form draft data, the form draft data is stored according to the standard storage parameters in various development modes supported by terminal equipment, a target component method description corresponding to the component method identification is searched from a cache according to the form draft component identification and the component method identification, at least one form draft component registration data is stored in the cache, and a calling method corresponding to the development mode of the service caller is used according to the component method identification and the form draft parameter to execute calling of the target component method description. Therefore, data sharing and code multiplexing of the form draft component in three development modes are realized.

Description

Form draft component sharing method and device, terminal device and readable storage medium
The embodiment of the invention requires the priority of Chinese patent application with application number 201710730714.1, application name "method, device and system for sharing form draft assembly in multi-development mode" submitted by Chinese patent office in 2017, 08 and 23, and the entire content of the application is incorporated by reference in the embodiment of the invention.
Technical Field
The embodiment of the invention relates to a computer development technology, in particular to a form draft component sharing method and device, a terminal device and a readable storage medium.
Background
The development of the current mobile Application (APP) involves three development modes: native (Native) development mode, Hybrid (Hybrid) development mode, and real Native development mode. The three development modes have respective application scenes, and sometimes the same APP is developed by adopting the three development modes simultaneously.
The form is a main form for the user to input at the terminal, and for example, user registration information, article selling information and the like need to be presented to the user through the form. The filling of the form is a time-consuming process, so that in many cases, it is difficult for a user to complete the filling of the form at one time, and at this time, the form draft needs to be stored to support subsequent operations on the form by the user, where the subsequent operations on the form by the user include an operation of acquiring the form draft data, an operation of deleting the form draft data, and an operation of storing the form draft data. Under the condition that three development modes coexist, the three development modes correspond to forms realized by three technologies, and how to realize data sharing and code multiplexing of form draft data is a key factor influencing user experience and supporting service expansion.
In the prior art, one implementation manner is that Native encapsulates logic of form draft data operation into one component, a Native end can directly call the component, and the component can be directly registered in a Hybrid operating environment in a Hybrid development mode, so that although form data sharing between the Native development mode and the Hybrid development mode can be realized, data intercommunication with the read Native development mode cannot be realized, and code multiplexing in three development modes cannot be realized.
Disclosure of Invention
The embodiment of the invention provides a form draft component sharing method and device, terminal equipment and a readable storage medium, so as to realize data sharing and code multiplexing corresponding to the form draft component in three development modes.
In a first aspect, an embodiment of the present invention provides a method for sharing a form draft component, including:
receiving component calling parameters transmitted by a service calling party, wherein the component calling parameters comprise form draft component identification, component method identification and form draft parameters, the form draft parameters comprise at least one parameter in standard storage parameters of form draft data, and the form draft data are stored according to the standard storage parameters in various development modes supported by terminal equipment;
according to the form draft component identification and the component method identification, searching a target component method description corresponding to the component method identification from a cache, wherein at least one form draft component registration data is stored in the cache, and the form draft component registration data comprises: a component identification and a component registration data class, the component registration data class comprising a component class name and a set of component methods, the set of component methods comprising at least one component method description;
and executing the calling of the target component method description by using a calling method corresponding to the development mode of the service caller according to the component method identification and the form draft parameter.
Optionally, the standard storage parameters include: the method comprises the following steps of storing time of form draft data, a title of the form, an identifier of the form and each form item data of the form, wherein the form item data comprise: the name of the form item, the content of the form item, the server identification corresponding to the content of the form item and a plurality of data descriptions of the form item.
Optionally, the searching, according to the form draft component identifier and the component method identifier, for the target component method description corresponding to the component method identifier from the cache includes:
searching a target component registration data class corresponding to the form draft component identification;
and searching the target component method description corresponding to the component method identification from the target component registration data class.
Optionally, after searching for the target component method description corresponding to the component method identifier from the target component registration data class, the method further includes:
upon determining that the target component method description is an instance method description, creating an instance of the target component registry dataclass.
Optionally, the method further includes:
simultaneously registering the form draft assembly and the method when the form draft assembly is loaded by the runtime environment;
and storing the registered form draft assembly and the registered data of the form draft assembly corresponding to the method in the cache.
Optionally, the at least one form draft component registration data is a service code in a Native development mode, and the development mode of the service caller is any one of a Native development mode, a Hybrid development mode, and a read Native development mode.
In a second aspect, an embodiment of the present invention provides a form draft component sharing apparatus, including:
the receiving module is used for receiving component calling parameters transmitted by a service calling party, wherein the component calling parameters comprise form draft component identification, component method identification and form draft parameters, the form draft parameters comprise at least one parameter in standard storage parameters of form draft data, and the form draft data are stored according to the standard storage parameters in various development modes supported by terminal equipment;
a searching module, configured to search, according to the form draft component identifier and the component method identifier, a target component method description corresponding to the component method identifier from a cache, where at least one form draft component registration data is stored in the cache, where the form draft component registration data includes: a component identification and a component registration data class, the component registration data class comprising a component class name and a set of component methods, the set of component methods comprising at least one component method description;
and the calling module is used for executing the calling of the target component method description by using a calling method corresponding to the development mode of the service caller according to the component method identification and the form draft parameter.
Optionally, the standard storage parameters include: the method comprises the following steps of storing time of form draft data, a title of the form, an identifier of the form and each form item data of the form, wherein the form item data comprise: the name of the form item, the content of the form item, the server identification corresponding to the content of the form item and a plurality of data descriptions of the form item.
Optionally, the search module is configured to:
searching a target component registration data class corresponding to the form draft component identification;
and searching the target component method description corresponding to the component method identification from the target component registration data class.
Optionally, the search module is further configured to:
and after searching a target component method description corresponding to the component method identification from the target component registration data class, when determining that the target component method description is an example method description, creating an example of the target component registration data class.
Optionally, the apparatus further comprises:
the registration module is used for simultaneously registering the form draft assembly and the method when the form draft assembly is loaded by the runtime environment;
and the storage module is used for storing the registered form draft assembly and the registered data of the form draft assembly corresponding to the method in the cache.
Optionally, the at least one form draft component registration data is a service code in a Native development mode, and the development mode of the service caller is any one of a Native development mode, a Hybrid development mode, and a read Native development mode.
In a third aspect, an embodiment of the present invention provides a terminal device, including:
a memory for storing program instructions;
a processor for calling and executing the program instructions in the memory to implement the form draft component sharing method of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a readable storage medium, in which a computer program is stored, and when the computer program is executed by at least one processor of the form draft component sharing apparatus, the form draft component sharing apparatus executes the form draft component sharing method of the first aspect.
On one hand, by storing form draft data in various development modes supported by the terminal device according to standard storage parameters, the data in different development modes can be used universally, and on the other hand, by storing at least one form draft component registration data in a cache of the terminal device, the form draft component registration data includes: the method comprises the steps that a component identification and a component registration data class are included, the component registration data class comprises a component class name and a component method set, the component method set comprises at least one component method description, therefore after component calling parameters transmitted by a service calling party are received, a target component method description corresponding to the component method identification can be found from a cache according to a form draft component identification and the component method identification in the component calling parameters, and finally calling of the target component method description is executed by using a calling method corresponding to a development mode of the service calling party. The same form draft component registration data only needs to be stored, and data sharing and code multiplexing of the form draft component in three development modes are achieved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flowchart of a first embodiment of a form draft component sharing method provided by the present invention;
FIG. 2 is a diagram of a form according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a cache structure according to the present invention;
FIG. 4 is a flowchart of a second embodiment of a form draft component sharing method provided by the present invention;
FIG. 5 is a schematic structural diagram of a form draft component sharing apparatus according to a first embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a second embodiment of an application component sharing apparatus according to the present invention;
fig. 7 is a schematic structural diagram of an embodiment of a terminal device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention without any creative efforts shall fall within the protection scope of the embodiments of the present invention.
In the prior art, under the condition that three development modes coexist, the form realized by three technologies corresponds to, and in order to realize data sharing and code multiplexing, one conventional realization mode is that Native encapsulates logic of form draft data operation into one component, a Native end can be directly called, and the component can be directly registered in a Hybrid operating environment in the Hybrid development mode, so that only form data sharing between the Native development mode and the Hybrid development mode can be realized, but the form data sharing cannot be intercommunicated with data in the read Native development mode, and code multiplexing in the three development modes cannot be realized. To solve the problem, embodiments of the present invention provide a form draft component sharing method and apparatus, a terminal device, and a readable storage medium, on one hand, by storing form draft data in various development modes supported by the terminal device according to standard storage parameters, data in different development modes can be used in common, and on the other hand, by storing at least one form draft component registration data in a cache of the terminal device, the form draft component registration data includes: the method comprises the steps that a component identification and a component registration data class are included, the component registration data class comprises a component class name and a component method set, the component method set comprises at least one component method description, therefore after component calling parameters transmitted by a service calling party are received, a target component method description corresponding to the component method identification can be found from a cache according to a form draft component identification and the component method identification in the component calling parameters, and finally calling of the target component method description is executed by using a calling method corresponding to a development mode of the service calling party. The same form draft component registration data only needs to be stored, and data sharing and code multiplexing of the form draft component in three development modes are achieved. The following describes a form draft component sharing method according to an embodiment of the present invention in detail with reference to the accompanying drawings.
First, some terms in the embodiments of the present invention are explained below to facilitate understanding by those skilled in the art.
1. Terminal devices, including but not limited to a Mobile Station (MS), a Mobile Terminal (Mobile Terminal), a Mobile phone (Mobile Telephone), a handset (handset), a portable device (portable equipment), etc., may communicate with one or more core networks via a Radio Access Network (RAN), for example, the Terminal devices may be a Mobile phone (or "cellular" phone), a computer with a wireless communication function, etc., and may also be a portable, pocket, hand-held, computer-embedded or vehicle-mounted Mobile device or device.
Fig. 1 is a flowchart of a first embodiment of a form draft component sharing method provided by the present invention, where an execution main body of the embodiment may be a form draft component sharing device, and the device may be implemented by hardware and/or software. The apparatus may be provided in a terminal device. Specifically, the apparatus may be a component factory in a terminal device, and as shown in fig. 1, the method of this embodiment may include:
s101, receiving component calling parameters transmitted by a service calling party, wherein the component calling parameters comprise form draft component identification, component method identification and form draft parameters, the form draft parameters comprise at least one parameter in standard storage parameters of form draft data, and the form draft data are stored according to the standard storage parameters in various development modes supported by terminal equipment.
Specifically, an execution subject of this embodiment is, for example, a component factory in a terminal device, and for a certain service caller, a component method description in a certain form draft component is to be called, the component factory provides a specific Application Programming Interface (API), and introduces a component calling parameter through the API, where the component calling parameter includes a form draft component identifier, a component method identifier, and a form draft parameter.
The form draft parameters comprise at least one parameter in standard storage parameters of the form draft data, the form draft data are stored according to the standard storage parameters in various development modes supported by the terminal equipment, so that the data can be used universally in different development modes, for example, the form draft data stored in a Native development mode can be directly used in a Hybrid development mode or a read Native development mode, the data are compatible, a user can use the data universally in different versions and different equipment, and the user experience and the compatibility between applications are improved.
Optionally, the standard storage parameters in this embodiment may include: the method comprises the following steps of storing time of form draft data, a title of the form, an identifier of the form and each form item data of the form, wherein the form item data comprise: the name of the form item, the content of the form item, the server identification corresponding to the content of the form item and a plurality of data descriptions of the form item. For example, the standard storage parameters correspond to the following codes:
Figure BDA0001735322930000071
Figure BDA0001735322930000081
fig. 2 is a schematic diagram of a form according to an embodiment of the present invention. Referring to fig. 2, a form includes a plurality of form items, such as gender, user name, password, address, etc. which are all form items. The standard storage parameters of the form draft data include: the storage time of the form draft data, the title of the form, the identification of the form and each form item data of the form; wherein the form data includes: the name of the form item, the content of the form item, the server identifier corresponding to the content of the form item, and a plurality of data descriptions of the form item, which are also referred to as the hierarchy of the form item, for example, the hierarchy of the form item is 2, and the content of the form item can be divided into the content of a first-level form item and the content of a second-level form item. For example, for the form item "gender", the form item data of the form item is: name (name of form item), server identification corresponding to "man" (server identification corresponding to form item content, for example, man can be 1, woman can be 0), man (form item content). For another example, the form entry of "address" has the form entry data: the system comprises an address, a server identifier corresponding to Shaanxi province, Shaanxi province and Western Ann city, wherein the Shaanxi province is the content of a first-level form, and the Western Ann city is the content of a second-level form.
As will be appreciated by those skilled in the art, a form item has form data only after its information has been filled in by the user.
In this embodiment, the form draft component includes storage, acquisition, and deletion of form draft data, and the specific API design is, for example, as follows (iOS is taken as an example):
@interface WBDraftInfoManager:NSObject
(void) saverdaftinfo (NSDirectional) dataDict with DraftId (NSString) draftId; // saving draft
(void) getDraftInfo (NSString) draftId; // obtaining draft
+ (BOOL) deleteDraftInfo (NSString) draftId; // delete draft case
@end
Based on the description of the standard storage parameters, the method for storing the form draft data needs to store the form draft data according to the standard storage parameters of the form draft data, namely, the storage time of the form draft data, the title of the form, the identifier of the form and each form item data of the form are stored; the method for deleting the form draft data needs to delete according to the standard storage parameters of the form draft data, namely deleting the storage time of the form draft data, the title of the form, the identifier of the form and each form item data of the form; the method for acquiring the form draft data needs to acquire the form draft data according to standard storage parameters of the form draft data, namely acquiring the storage time of the form draft data, the title of the form, the identifier of the form and each form item data of the form.
S102, according to the form draft component identification and the component method identification, searching a target component method description corresponding to the component method identification from a cache, and storing at least one form draft component registration data in the cache, wherein the form draft component registration data comprises: the component identification and component registration data class comprises a component class name and a component method set, and the component method set comprises at least one component method description.
The cache is a memory cache of the terminal device, the cache in this embodiment is a Map structure, one form includes multiple components, only one copy of registration data of a form draft component of the same kind is stored, multiple forms of draft component registration data can be stored in the cache, fig. 3 is a schematic structural diagram of the cache provided by the present invention, as shown in fig. 3, the registration data of each form draft component is stored in a key-value pair form, and the registration data of the form draft component includes: the method comprises a component identification and a component registration data class, wherein a key (key) is the component identification of a form draft component, a value (value) is the component registration data class, the component registration data class comprises a component class name and a component method set, the component method set comprises at least one component method description, and the component method description comprises a method name, the number of parameters of the method and the sequence of the parameters of the method. The set of component methods as shown in FIG. 3 includes component method description 1, component method description 2, and so on. The cache shown in fig. 3 stores 4 form draft component registration data, which is taken as 4 in this embodiment, and may be other examples, which is not limited in this embodiment.
Specifically, in S102, according to the form draft component identifier and the component method identifier, searching for the target component method description corresponding to the component method identifier from the cache may include:
s1021, first, find a target component registration data class corresponding to the form draft component identifier, taking fig. 2 as an example, where, for example, the form draft component identifier is a component identifier 1, and the target component registration data class corresponding to the component identifier 1 is a component registration data class 1.
S1022, searching target component method description corresponding to the component method identification from the target component registration data class.
Specifically, after the target component registration data class is found, a target component method description corresponding to the component method identifier is found from the target component registration data class, for example, if the form draft component identifier is component identifier 1 and the component method identifier is method 2, a target component method description corresponding to method 2 is found from the component registration data class 1.
Further, after S1022, the method may further include:
s1023, when the target component method description is determined to be the example method description, an example of the target component registration data class is created.
Specifically, creating an instance of a class is an instance of instantiating a specific class, if a target component method description corresponding to a component method identifier is a class method description, the instantiation is not required, and a call to the target component method description can be directly executed, if the target component method description corresponding to the component method identifier is an instance method description, the instantiation is required, and the call to the target component method description can be executed only after the instantiation, different development modes correspond to different code languages, the different code languages are different in the process of instantiating the instance of the specific class according to the class name, taking iOS as an example, and the instantiation is performed according to a reflection API provided in running (runtime).
S103, according to the component method identification and the form draft parameter, a calling method corresponding to the development mode of the service caller is used for calling the target component method description.
In particular, the form draft parameter is an array type, and the order of the parameters must be consistent with the order of the parameters of the methods in the component method description. If the target component method description is found in the step S102, it is indicated that calling is possible, and then according to the component method identifier and the form draft parameter, a calling method corresponding to the development mode of the service caller is used to execute calling of the target component method description, where the calling methods corresponding to different development modes are different.
In this embodiment, optionally, at least one of the form draft component registration data is a service code in a Native development mode, that is, the form draft component of this embodiment is a component encapsulated by a Native code. The development mode of the service calling party is any one of a pure Native development mode, a Hybrid development mode or a read Native development mode.
In this embodiment, when the development mode of the service caller is a Native development mode, the Native development mode is the same as the code of the registered data of the form draft component, and the Native development mode can be directly called. When the development mode of the service caller is the read Native development mode, the development mode can be called by the following js (javascript) calling method, for example:
and the JS end compiles and analyzes the service code corresponding to the target component method description through related processing, extracts class names/component method descriptions/parameters, then sends the extracted information to the Native end, and the Native end calls a method execution code in a component factory to execute related data and returns the data to the JS end. In the process, the process of compiling and resolving, the process of extracting class name/component method description/parameter and the process of transmitting the data to Native are all basic capabilities provided by the development framework.
In the method for sharing a form draft component provided in this embodiment, on one hand, the form draft data is stored according to the standard storage parameter in each development mode supported by the terminal device, so that the data in different development modes can be used in common, and on the other hand, at least one type of form draft component registration data is stored in the cache of the terminal device, where the form draft component registration data includes: the method comprises the steps that a component identification and a component registration data class are included, the component registration data class comprises a component class name and a component method set, the component method set comprises at least one component method description, therefore after component calling parameters transmitted by a service calling party are received, a target component method description corresponding to the component method identification can be found from a cache according to a form draft component identification and the component method identification in the component calling parameters, and finally calling of the target component method description is executed by using a calling method corresponding to a development mode of the service calling party. The same form draft component registration data only needs to be stored, and data sharing and code multiplexing of the form draft component in three development modes are achieved.
Fig. 4 is a flowchart of a second embodiment of the form draft component sharing method provided by the present invention, where an execution main body of the present embodiment may be a form draft component sharing device, and the device may be implemented by hardware and/or software. The apparatus may be provided in a terminal device. Specifically, the apparatus may be a component factory in a terminal device, and compared with the embodiment shown in fig. 1, in this embodiment, how to register the form draft component and the method, and a process of storing the registration data of the form draft component in the cache are described in detail, as shown in fig. 4, the method of this embodiment may include:
s201, registering the form draft assembly and the method simultaneously when the form draft assembly is loaded by the runtime environment.
Specifically, in this embodiment, the registration of the form draft component and the method is performed simultaneously and collectively, and all the components are selected to be automatically executed when the component class of the form draft component is loaded by the runtime environment. The specific encapsulated macros are defined as follows:
Figure BDA0001735322930000111
Figure BDA0001735322930000121
in the above code, the REGISTER macro REGISTER _ HYBRID _ MODULE has two parameters, modelkey and methoddit. The module key is a form draft component identifier (also called a mapping name), and the service caller can find the corresponding form draft component by inputting the module key. And if the modelkey transmitted by the service caller is empty or the length of the modelkey is 0, the current component class name is taken as the modelkey by default. Secondly, a methodDict parameter, wherein key of the parameter is a mapping name of a method needing to be registered, and value is description of a component method in a form draft component. By passing in the component method identification (keyName), the component factory can find the component method description of the corresponding form draft component.
The wbblendfactor is a component factory described in this embodiment, and the component factory stores data of registered form draft components and methods. The registeraActionModule method is a registration API provided by the component factory to store the registered form draft component registration data.
The above-mentioned registration logic is performed in the load method. The load method is automatically executed when the loading of the current component class in the runtime environment is finished, the registration of the method is put into the load method to be executed together in the embodiment, which is beneficial to improving the service initialization time under various development modes, and the execution of other codes during the framework initialization is not blocked because the registration of the form draft component and the method is preferentially executed. In addition, since the execution of the load method is executed when the application program is started, in order not to affect the starting time of the application program, the method registration logic in the embodiment is performed in the child thread, and the concurrent operation is supported. Even if a huge number of methods are registered, the influence can be ignored.
For the macro, the examples laid down in the specific form draft component may be:
REGISTER_HYBRID_MODULE((@”WBDraftInfo”,@{@"saveDraft":@"saveDraftInfo:",@"getDraft":@"getDraftInfo:",@"deleteDraft":@"deleteDraftInfo:"}))。
wherein "WBDraftInfo" is the key of the component "moduleKey", that is, the component identification, { @ "saveDraft": @ "saveDraftInfo:", @ getDraftDraftInfo: ", @ deletDraftInfo:" @ ", and @ deletDraftInfo:" } is the value of the component "methodDict". The @ SaveDraft ": the @ SaveDraftInfo is the key and value of the method for saving the form data draft, the key of the method is the name of the method, and the value of the method is the description of the method.
S202, storing registered form draft components and registered data of the form draft components corresponding to the method in a cache.
Wherein, the buffer memory stores at least one type of form draft component registration data, and the form draft component registration data comprises: the component identification and component registration data class comprises a component class name and a component method set, and the component method set comprises at least one component method description.
S203, receiving component calling parameters transmitted by a service calling party, wherein the component calling parameters comprise a form draft component identification, a component method identification and a form draft parameter.
For example, the component call parameters that the service caller enters are:
Figure BDA0001735322930000131
the modelname is a form draft component identifier, the actionName is a component method identifier, the params is a form draft parameter, the form draft parameter includes at least one parameter of standard storage parameters of form draft data, and the parameter is a data type in a JSON format, for example, as follows:
Figure BDA0001735322930000132
that is, the form draft parameters include the storage time of the form draft data, the title of the form, and the identity of the form.
When calling, the JS end processes the service code and splices into the component protocol in the JSON format, as follows:
{
"moduleName":"WBDraftInfoManager",
“actionName":"getDraft",
}
and S204, searching a target component method description corresponding to the component method identification from the cache according to the form draft component identification and the component method identification.
And S205, according to the component method identification and the form draft parameter, executing the calling of the target component method description by using a calling method corresponding to the development mode of the service caller.
The specific processes of S203-S205 are the same as S101-S103, and refer to S101-S103 specifically, which are not described herein again.
In the method for sharing a form draft component provided in this embodiment, on one hand, the form draft data is stored according to the standard storage parameters in each development mode supported by the terminal device, so that the data in different development modes can be used in common, and on the other hand, the form draft component and the method are simultaneously registered when the form draft component is loaded by the runtime environment, and the registration data of the form draft component corresponding to the registered form draft component and the method is stored in the cache, where the registration data of the form draft component includes: the method comprises the steps that a component identification and a component registration data class are included, the component registration data class comprises a component class name and a component method set, the component method set comprises at least one component method description, therefore after component calling parameters transmitted by a service calling party are received, a target component method description corresponding to the component method identification can be found from a cache according to a form draft component identification and the component method identification in the component calling parameters, and finally calling of the target component method description is executed by using a calling method corresponding to a development mode of the service calling party. The same form draft component registration data only needs to be stored, and data sharing and code multiplexing of the form draft component in three development modes are achieved.
Fig. 5 is a schematic structural diagram of a first embodiment of a form draft assembly sharing device provided by the present invention, and as shown in fig. 5, the device of the present embodiment may include: the system comprises a receiving module 11, a searching module 12 and a calling module 13, wherein the receiving module 11 is configured to receive a component calling parameter transmitted by a service caller, the component calling parameter includes a form draft component identifier, a component method identifier and a form draft parameter, the form draft parameter includes at least one parameter of standard storage parameters of form draft data, and the form draft data is stored according to the standard storage parameters in various development modes supported by a terminal device.
The search module 12 is configured to search, according to the form draft component identifier and the component method identifier, a target component method description corresponding to the component method identifier from a cache, where at least one type of form draft component registration data is stored in the cache, where the form draft component registration data includes: the component identification and component registration data class comprises a component class name and a component method set, and the component method set comprises at least one component method description.
The calling module 13 is configured to execute calling of the target component method description by using a calling method corresponding to the development mode of the service caller according to the component method identifier and the form draft parameter.
Optionally, the standard storage parameters include: the method comprises the following steps of storing time of form draft data, a title of the form, an identifier of the form and each form item data of the form, wherein the form item data comprise: the name of the form item, the content of the form item, the server identification corresponding to the content of the form item and a plurality of data descriptions of the form item.
Optionally, the search module 12 is configured to:
searching a target component registration data class corresponding to the form draft component identification;
and searching the target component method description corresponding to the component method identification from the target component registration data class.
Optionally, the search module is further configured to:
and creating an example of the target component registration data class when the target component method description is determined to be the example method description after the target component method description corresponding to the component method identification is searched from the target component registration data class.
The apparatus of this embodiment may be configured to implement the technical solution of the method embodiment shown in fig. 1, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of a second embodiment of an application component sharing device provided by the present invention, as shown in fig. 6, on the basis of the device shown in fig. 5, further, the device of this embodiment may further include: a registration module 14 and a storage module 15.
The registration module 14 is configured to simultaneously register the form draft assembly and the method when the form draft assembly is loaded by the runtime environment;
the storage module 15 is configured to store the registered form draft components and the registered data of the form draft components corresponding to the method in the cache.
In the above embodiment, optionally, the at least one form draft component registration data is a service code in a Native development mode, and the development mode of the service caller is any one of a Native development mode, a Hybrid development mode, and a read Native development mode.
The apparatus of this embodiment may be configured to execute the technical solution of the method embodiment shown in fig. 4, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of an embodiment of a terminal device provided in the present invention, and as shown in fig. 7, the terminal device of this embodiment may include: a memory 21, a processor 22 and an input/output interface 23,
a memory 21 for storing program instructions, which may be a flash (flash memory).
A processor 22 for calling and executing program instructions in the memory to implement the steps of the form draft component sharing method shown in fig. 1 or 4. Reference may be made in particular to the description relating to the preceding method embodiment.
Alternatively, the memory 21 may be independent, or the memory 21 may be integrated with the processor 22.
An embodiment of the present invention further provides a readable storage medium, in which a computer program is stored, and when at least one processor of the form draft component sharing apparatus executes the computer program, the form draft component sharing apparatus executes the form draft component sharing method according to the first aspect.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (12)

1. A form draft component sharing method, comprising:
receiving component calling parameters transmitted by a service calling party, wherein the component calling parameters comprise form draft component identification, component method identification and form draft parameters, the form draft parameters comprise at least one parameter in standard storage parameters of form draft data, and the form draft data are stored according to the standard storage parameters in various development modes supported by terminal equipment;
the standard storage parameters include: the method comprises the following steps of storing time of form draft data, a title of the form, an identifier of the form and each form item data of the form, wherein the form item data comprise: the name of the form item, the content of the form item, the server identification corresponding to the content of the form item and a plurality of data descriptions of the form item;
according to the form draft component identification and the component method identification, searching a target component method description corresponding to the component method identification from a cache, wherein at least one form draft component registration data is stored in the cache, and the form draft component registration data comprises: a component identification and a component registration data class, the component registration data class comprising a component class name and a set of component methods, the set of component methods comprising at least one component method description;
and executing the calling of the target component method description by using a calling method corresponding to the development mode of the service caller according to the component method identification and the form draft parameter.
2. The method of claim 1, wherein the searching for the target component method description corresponding to the component method identifier from the cache according to the form draft component identifier and the component method identifier comprises:
searching a target component registration data class corresponding to the form draft component identification;
and searching the target component method description corresponding to the component method identification from the target component registration data class.
3. The method of claim 2, wherein after searching the target component method description corresponding to the component method identification from the target component registration data class, the method further comprises:
upon determining that the target component method description is an instance method description, creating an instance of the target component registry dataclass.
4. The method according to any one of claims 1-3, further comprising:
simultaneously registering the form draft assembly and the method when the form draft assembly is loaded by the runtime environment;
and storing the registered form draft assembly and the registered data of the form draft assembly corresponding to the method in the cache.
5. The method according to any one of claims 1 to 3, wherein the at least one form draft component registration data is a business code in Native development mode, and the development mode of the business caller is any one of Native development mode, Hybrid development mode or read Native development mode.
6. A form draft component sharing apparatus, comprising:
the receiving module is used for receiving component calling parameters transmitted by a service calling party, wherein the component calling parameters comprise form draft component identification, component method identification and form draft parameters, the form draft parameters comprise at least one parameter in standard storage parameters of form draft data, and the form draft data are stored according to the standard storage parameters in various development modes supported by terminal equipment;
the standard storage parameters include: the method comprises the following steps of storing time of form draft data, a title of the form, an identifier of the form and each form item data of the form, wherein the form item data comprise: the name of the form item, the content of the form item, the server identification corresponding to the content of the form item and a plurality of data descriptions of the form item;
a searching module, configured to search, according to the form draft component identifier and the component method identifier, a target component method description corresponding to the component method identifier from a cache, where at least one form draft component registration data is stored in the cache, where the form draft component registration data includes: a component identification and a component registration data class, the component registration data class comprising a component class name and a set of component methods, the set of component methods comprising at least one component method description;
and the calling module is used for executing the calling of the target component method description by using a calling method corresponding to the development mode of the service caller according to the component method identification and the form draft parameter.
7. The apparatus of claim 6, wherein the lookup module is configured to:
searching a target component registration data class corresponding to the form draft component identification;
and searching the target component method description corresponding to the component method identification from the target component registration data class.
8. The apparatus of claim 7, wherein the lookup module is further configured to:
and after searching a target component method description corresponding to the component method identification from the target component registration data class, when determining that the target component method description is an example method description, creating an example of the target component registration data class.
9. The apparatus according to any one of claims 6-8, further comprising:
the registration module is used for simultaneously registering the form draft assembly and the method when the form draft assembly is loaded by the runtime environment;
and the storage module is used for storing the registered form draft assembly and the registered data of the form draft assembly corresponding to the method in the cache.
10. The apparatus according to any of claims 6-8, wherein the at least one form draft component registration data is a business code in Native development mode, and the development mode of the business caller is any one of Native development mode, Hybrid development mode, or read Native development mode.
11. A terminal device, comprising:
a memory for storing program instructions;
a processor for invoking and executing program instructions in the memory to implement the form draft component sharing method of any of claims 1-6.
12. A readable storage medium having stored therein a computer program which, when executed by at least one processor of a form draft component sharing apparatus, causes the form draft component sharing apparatus to perform the form draft component sharing method of any one of claims 1 to 5.
CN201810792876.2A 2017-08-23 2018-07-18 Form draft component sharing method and device, terminal device and readable storage medium Active CN108920246B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710730714 2017-08-23
CN2017107307141 2017-08-23

Publications (2)

Publication Number Publication Date
CN108920246A CN108920246A (en) 2018-11-30
CN108920246B true CN108920246B (en) 2021-09-21

Family

ID=64416090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810792876.2A Active CN108920246B (en) 2017-08-23 2018-07-18 Form draft component sharing method and device, terminal device and readable storage medium

Country Status (1)

Country Link
CN (1) CN108920246B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753366A (en) * 2018-12-10 2019-05-14 北京城市网邻信息技术有限公司 Operation data management method, device, computer equipment and storage medium
CN112347378A (en) * 2019-08-07 2021-02-09 北京国双科技有限公司 Form generation method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103809975A (en) * 2014-02-19 2014-05-21 浪潮软件股份有限公司 Method for achieving intelligent cloud forms
CN104995927A (en) * 2013-01-15 2015-10-21 微软技术许可有限责任公司 Systems and methods for building and using hybrid mobile applications
CN105721408A (en) * 2014-12-05 2016-06-29 中国移动通信集团公司 RCS client realization method, terminal, relevant platform and system
CN105843814A (en) * 2015-01-14 2016-08-10 阿里巴巴集团控股有限公司 Method, device, and system for generating page

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7325007B2 (en) * 2005-03-07 2008-01-29 Microsoft Corporation System and method for supporting non-native data types in a database API
US20100064228A1 (en) * 2008-09-11 2010-03-11 Ely Tsern Expandable system architecture comprising a handheld computer device that dynamically generates different user environments with secondary devices with displays of various form factors
WO2016004188A1 (en) * 2014-07-03 2016-01-07 FishEye Products, LLC Realtime processing of streaming data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104995927A (en) * 2013-01-15 2015-10-21 微软技术许可有限责任公司 Systems and methods for building and using hybrid mobile applications
CN103809975A (en) * 2014-02-19 2014-05-21 浪潮软件股份有限公司 Method for achieving intelligent cloud forms
CN105721408A (en) * 2014-12-05 2016-06-29 中国移动通信集团公司 RCS client realization method, terminal, relevant platform and system
CN105843814A (en) * 2015-01-14 2016-08-10 阿里巴巴集团控股有限公司 Method, device, and system for generating page

Also Published As

Publication number Publication date
CN108920246A (en) 2018-11-30

Similar Documents

Publication Publication Date Title
CN108958730B (en) Application program component sharing method and device, terminal device and readable storage medium
CN111859470B (en) Business data chaining method and device
US9913132B1 (en) System and method of mobile phone customization based on universal manifest
CN110019080B (en) Data access method and device
CN109408132A (en) A kind of configuration file processing method and server, user terminal, storage medium
CN109933381B (en) Kernel loading method and device
CN108804188A (en) Changing an interface skin method and device
CN108415708B (en) Application program installation package size processing method, device, equipment and storage medium
CN106201610A (en) Web application accesses the method and device of the primary function of terminal
CN104965848A (en) Front-end resource loading method and apparatus
US10021240B1 (en) System and method of mobile phone customization based on universal manifest with feature override
CN108228770A (en) A kind of method and device of application file source inquiry
JP2022041907A (en) Api mash-up infrastructure generation on computing system
CN108920246B (en) Form draft component sharing method and device, terminal device and readable storage medium
CN107368406A (en) The method, apparatus and equipment of test application program
CN114756306A (en) Service calling method, device, equipment and storage medium
CN107577629B (en) Data interface processing method, device, server and medium
CN110851211A (en) Method, apparatus, electronic device, and medium for displaying application information
CN105871960B (en) Method, device and equipment for calling data sharing
CN112243016A (en) Middleware platform, terminal equipment, 5G artificial intelligence cloud processing system and processing method
CN112214250A (en) Application program assembly loading method and device
CN103927301B (en) A kind of method and device of utilization theme bag dynamic translation entry
CN112882685A (en) Object extension method and device of object-oriented programming language
CN115934093A (en) Applet cross-terminal application method, related device and computer storage medium
CN107092601B (en) Resource file construction method, resource file application method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant