Method and device for generating file

文档序号:1953410 发布日期:2021-12-10 浏览:17次 中文

阅读说明:本技术 一种文案生成方法和装置 (Method and device for generating file ) 是由 贾伟 于 2020-08-20 设计创作,主要内容包括:本发明公开了文案生成方法和装置,涉及计算机技术领域。该方法的一具体实施方式包括接收文案生成请求,获取所述请求对应的文案模板;获取所述文案模板中的各动态参数,基于预设的第一模型对各动态参数进行类型识别;根据各动态参数的类型,分别调用相应的第二模型进行参数内容的替换,以基于文案模板生成文案。从而,本发明的实施方式能够解决消息触达的文案的动态参数不易管理、研发效率低下的问题,节省研发人力。(The invention discloses a method and a device for generating a file, and relates to the technical field of computers. One specific implementation mode of the method comprises the steps of receiving a document generation request and obtaining a document template corresponding to the request; acquiring each dynamic parameter in the file template, and identifying the type of each dynamic parameter based on a preset first model; and calling the corresponding second models respectively to replace the parameter content according to the types of the dynamic parameters so as to generate the file based on the file template. Therefore, the method and the device can solve the problems that dynamic parameters of the file touched by the message are difficult to manage and the research and development efficiency is low, and save research and development manpower.)

1. A method for generating a document, comprising:

receiving a document generation request, and acquiring a document template corresponding to the request;

acquiring each dynamic parameter in the file template, and identifying the type of each dynamic parameter based on a preset first model;

and calling the corresponding second models respectively to replace the parameter content according to the types of the dynamic parameters so as to generate the file based on the file template.

2. The method of claim 1, wherein the type identification of each dynamic parameter based on the preset first model comprises:

judging whether the name of the dynamic parameter is the same as the name of the upstream interface access parameter or not;

if yes, identifying the type of the dynamic parameter as a system built-in parameter;

if not, judging whether the replacement content of the dynamic parameter is obtained by calling through a downstream interface, if so, identifying the type of the dynamic parameter as a transparent transmission parameter, and if not, identifying the type of the dynamic parameter as a self-defined parameter.

3. The method of claim 1, wherein the step of calling the corresponding second model to replace the parameter content according to the type of each dynamic parameter comprises:

judging whether the type is a system built-in parameter or not according to the type of the dynamic parameter;

and if the type is the system built-in parameter, calling a second model corresponding to the system built-in parameter, further positioning a corresponding upstream interface, and acquiring the replacement content according to the name of the dynamic parameter so as to update the dynamic parameter.

4. The method of claim 1, wherein the step of calling the corresponding second model to replace the parameter content according to the type of each dynamic parameter comprises:

judging whether the type is a user-defined parameter or not according to the type of the dynamic parameter;

if the type is the self-defined parameter, calling a second model corresponding to the self-defined parameter, further positioning a corresponding upstream interface, and acquiring the replacement content according to the interface parameter name corresponding to the dynamic parameter name; and carrying out logic processing on the replacement content based on preset analysis logic to obtain the processed replacement content so as to update the dynamic parameters.

5. The method of claim 4, wherein the logic processing of the replacement content based on the preset parsing logic comprises:

and executing preset parsing logic through a pre-configured dynamic language or a rule engine so as to perform logic processing on the replacement content.

6. The method of claim 1, wherein the step of calling the corresponding second model to replace the parameter content according to the type of each dynamic parameter comprises:

judging whether the type is a transparent transmission parameter or not according to the type of the dynamic parameter;

and if the type is the transparent transmission parameter, calling a second model corresponding to the transparent transmission parameter, positioning a corresponding downstream interface, and acquiring the replacement content through the transparent transmission of the parameter so as to update the dynamic parameter.

7. The method according to any one of claims 1 to 6, wherein after identifying the type of each dynamic parameter based on the preset first model, the method comprises:

judging whether the type of the dynamic parameter is identified, if so, calling a corresponding second model to replace the parameter content according to the type of the dynamic parameter; if not, judging whether the cycle number of the currently identified dynamic parameter is greater than a preset number threshold, if so, not generating a file and outputting a request exception notification, otherwise, continuously identifying the type of the dynamic parameter.

8. A document creation apparatus, comprising:

the receiving module is used for receiving a document generation request and acquiring a document template corresponding to the request;

the identification module is used for acquiring each dynamic parameter in the document template and identifying the type of each dynamic parameter based on a preset first model;

and the generating module is used for respectively calling the corresponding second models to replace the parameter contents according to the types of the dynamic parameters so as to generate the file based on the file template.

9. An electronic device, comprising:

one or more processors;

a storage device for storing one or more programs,

when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.

10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.

Technical Field

The invention relates to the technical field of computers, in particular to a method and a device for generating a file.

Background

The message touch refers to a behavior process of pushing the file to the user through a way of receiving the information of the service provider by the user through a product of the user or a third party and the like. The message touch can realize marketing activity content notification, personal associated system function push and the like, and is a bridge between a service provider and a user. In message reach, the file management is the most important, and a good reach file can greatly promote the user activity, enhance the user viscosity and improve the retention of the user and the utilization rate of related functional modules.

In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:

the file management of the message touch depends on the file template, and the file is generated by replacing the dynamic parameters in the file template with the corresponding replacement contents. However, in the prior art, the dynamic parameter management in the document template depends heavily on the developed programming, and when the document requirement changes, the code needs to be modified, joint debugging, testing and online, so the existing dynamic parameters are not easy to manage, the development efficiency is low, and the research and development manpower is greatly wasted.

Disclosure of Invention

In view of this, embodiments of the present invention provide a document generation method and apparatus, which can solve the problems of difficult management of dynamic parameters of a document reached by a message and low research and development efficiency, and save research and development manpower.

In order to achieve the above object, according to an aspect of the embodiments of the present invention, a method for generating a document is provided, including receiving a request for generating a document, and obtaining a document template corresponding to the request; acquiring each dynamic parameter in the file template, and identifying the type of each dynamic parameter based on a preset first model; and calling the corresponding second models respectively to replace the parameter content according to the types of the dynamic parameters so as to generate the file based on the file template.

Optionally, the type recognition of each dynamic parameter based on a preset first model includes:

judging whether the name of the dynamic parameter is the same as the name of the upstream interface access parameter or not;

if yes, identifying the type of the dynamic parameter as a system built-in parameter;

if not, judging whether the replacement content of the dynamic parameter is obtained by calling through a downstream interface, if so, identifying the type of the dynamic parameter as a transparent transmission parameter, and if not, identifying the type of the dynamic parameter as a self-defined parameter.

Optionally, according to the type of each dynamic parameter, respectively invoking a corresponding second model to perform parameter content replacement, including:

judging whether the type is a system built-in parameter or not according to the type of the dynamic parameter;

and if the type is the system built-in parameter, calling a second model corresponding to the system built-in parameter, further positioning a corresponding upstream interface, and acquiring the replacement content according to the name of the dynamic parameter so as to update the dynamic parameter.

Optionally, according to the type of each dynamic parameter, respectively invoking a corresponding second model to perform parameter content replacement, including:

judging whether the type is a user-defined parameter or not according to the type of the dynamic parameter;

if the type is the self-defined parameter, calling a second model corresponding to the self-defined parameter, further positioning a corresponding upstream interface, and acquiring the replacement content according to the interface parameter name corresponding to the dynamic parameter name; and carrying out logic processing on the replacement content based on preset analysis logic to obtain the processed replacement content so as to update the dynamic parameters.

Optionally, performing logic processing on the replacement content based on a preset parsing logic, including:

and executing preset parsing logic through a pre-configured dynamic language or a rule engine so as to perform logic processing on the replacement content.

Optionally, according to the type of each dynamic parameter, respectively invoking a corresponding second model to perform parameter content replacement, including:

judging whether the type is a transparent transmission parameter or not according to the type of the dynamic parameter;

and if the type is the transparent transmission parameter, calling a second model corresponding to the transparent transmission parameter, positioning a corresponding downstream interface, and acquiring the replacement content through the transparent transmission of the parameter so as to update the dynamic parameter.

Optionally, after performing type identification on each dynamic parameter based on the preset first model, the method includes:

judging whether the type of the dynamic parameter is identified, if so, calling a corresponding second model to replace the parameter content according to the type of the dynamic parameter; if not, judging whether the cycle number of the currently identified dynamic parameter is greater than a preset number threshold, if so, not generating a file and outputting a request exception notification, otherwise, continuously identifying the type of the dynamic parameter.

In addition, the invention also provides a document generation device, which comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving the document generation request and acquiring the document template corresponding to the request; the identification module is used for acquiring each dynamic parameter in the document template and identifying the type of each dynamic parameter based on a preset first model; and the generating module is used for respectively calling the corresponding second models to replace the parameter contents according to the types of the dynamic parameters so as to generate the file based on the file template.

One embodiment of the above invention has the following advantages or benefits: the dynamic parameters are defined into the system built-in parameters, the user-defined parameters and the transparent parameters in a classified manner, and are configured and processed according to different dynamic parameter types, and different configuration and processing modes are adopted for different dynamic parameters, so that the code modification, joint debugging, testing and online processing are not required to be carried out on each dynamic parameter when the file requirement changes, the problems of difficult management of the dynamic parameters and low research and development efficiency can be solved, and the technical effects of improving the research and development efficiency and saving the research and development manpower are achieved.

Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.

Drawings

The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:

FIG. 1 is a schematic diagram of a main flow of a document generation method according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a main flow of dynamic parameter configuration according to an embodiment of the present invention;

FIG. 3 is a schematic diagram of the main flow of dynamic parameter conversion into dynamic documentation according to an embodiment of the present invention;

FIG. 4 is a schematic diagram of the main modules of a document creation apparatus according to an embodiment of the present invention;

FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;

fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.

Detailed Description

Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

Fig. 1 is a schematic diagram of a main flow of a document generation method according to a first embodiment of the present invention, as shown in fig. 1, the document generation method includes:

step one, receiving a document generation request and acquiring a document template corresponding to the request.

And step two, acquiring each dynamic parameter in the file template, and identifying the type of each dynamic parameter based on a preset first model.

In some embodiments, when performing the type identification on each dynamic parameter based on the preset first model in step two, it may be determined whether the name of the dynamic parameter is the same as the name of the upstream interface access parameter. And according to the judgment result, if so, identifying the type of the dynamic parameter as a system built-in parameter, otherwise, judging whether the replacement content of the dynamic parameter is acquired by calling a downstream interface, if so, identifying the type of the dynamic parameter as a transparent transmission parameter, and otherwise, identifying the type of the dynamic parameter as a self-defined parameter.

And step three, respectively calling corresponding second models to replace the parameter content according to the types of the dynamic parameters so as to generate the file based on the file template.

In the embodiment, each dynamic parameter is divided into a system built-in parameter, a self-defined parameter or a transparent transmission parameter and configured according to the analysis content source of each dynamic parameter in the file template required to be configured. The configuration of the system built-in parameters requires the system to be in butt joint with the source of file information acquisition, namely an upstream interface. The configuration of the custom parameters requires that a user firstly creates corresponding parameter names in a system background, and then creates the analysis logic of the file contents by relying on the built-in parameters of the system or other created custom parameters. Note that the custom parameters cannot be named the same as the system support parameters. The transparent transmission parameters do not need to be configured, and the replacement contents can be directly acquired through parameter transmission and replaced.

When the system-embedded parameter is used to generate the document template, the replacement content is called from the corresponding upstream interface and replaced. For example: the processing of the system built-in parameters generally obtains relevant data through calling of a micro service interface, and then corresponding parameters and parameter assignment logic are matched in a one-to-one mode through a hard coding mode. And when the customized parameters are used for generating the document template, the corresponding analysis codes are executed to obtain the replacement contents and replace the contents. When the transparent transmission parameter is used for generating the file template, the replacement content is directly obtained through parameter transmission and is replaced, namely, the transparent transmission parameter completely depends on the parameter transmission of a calling party.

It is worth noting that the documentation is the documentation used by the user for message access. The dynamic parameter is a corresponding mark parameter of the document template that needs to dynamically replace the content, and is generally a parameter that the replaced content corresponds to a different name. The system built-in parameters are dynamic parameters which reach the system built-in support, and can take effect without user-defined configuration. The custom parameter is a parameter configured to execute a new replacement scenario logic based on other defined parameters (including the system built-in parameter and the defined custom parameter). The transparent transmission parameter is a parameter directly transmitted when the user message is touched, and can directly assign a value to a dynamic parameter in a file.

In some embodiments, invoking the corresponding second model to replace the parameter content according to the type of each dynamic parameter may include:

and judging whether the type is a system built-in parameter or not according to the type of the dynamic parameter. And if the type is the system built-in parameter, calling a second model corresponding to the system built-in parameter, further positioning a corresponding upstream interface, and acquiring the replacement content according to the name of the dynamic parameter so as to update the dynamic parameter.

Or judging whether the type is a self-defined parameter according to the type of the dynamic parameter;

if the type is the self-defined parameter, calling a second model corresponding to the self-defined parameter, further positioning a corresponding upstream interface, and acquiring the replacement content according to the interface parameter name corresponding to the dynamic parameter name; and carrying out logic processing on the replacement content based on preset analysis logic to obtain the processed replacement content so as to update the dynamic parameters.

Preferably, when the replacement content is logically processed based on the preset parsing logic, the preset parsing logic may be executed through a pre-configured dynamic language or a rule engine to logically process the replacement content.

Or judging whether the type is a transparent transmission parameter according to the type of the dynamic parameter;

and if the type is the transparent transmission parameter, calling a second model corresponding to the transparent transmission parameter, positioning a corresponding downstream interface, and acquiring the replacement content through the transparent transmission of the parameter so as to update the dynamic parameter.

It should be further noted that, after the type identification is performed on each dynamic parameter based on the preset first model in the third step, whether the type of the dynamic parameter is identified or not can be judged, and if yes, the corresponding second model is called to perform parameter content replacement according to the type of the dynamic parameter; if not, judging whether the cycle number of the currently identified dynamic parameter is greater than a preset number threshold, if so, not generating a file and outputting a request exception notification, otherwise, continuously identifying the type of the dynamic parameter.

Fig. 2 is a schematic diagram of a main flow of dynamic parameter configuration according to an embodiment of the present invention, and as shown in fig. 2, a process of dynamic parameter configuration may include:

step s 101: and receiving a configuration request of the document template, and starting to configure the document template and the dynamic parameters by using the system by the user.

Step s 102: and the user combs out the document template to be configured and the dynamic parameters to be configured based on the configuration request of the document template.

The document template to be configured is, for example, a statement containing dynamic parameters to be configured. For example, the document template to be configured is "May you succeed in renewing the PLUS yearboard member, and the yearboard member expiration period is {0} to {1 }. You can unlock {2} immediately. Visit 3.cn/Sdloa9K tourist Bar for opening PLUS! ". Wherein {0}, {1} and {2} are dynamic parameters that need to be configured.

Step s 103: and (5) searching and comparing the dynamic parameters combed in the step s102, and judging whether similar dynamic parameters exist or not. If the determination result is yes, the process proceeds to step s104, and if the determination result is no, the process proceeds to step s 105.

The search comparison and determination may be performed independently for different dynamic parameters, and the steps described later may be performed independently. Specifically, for example, the document template to be arranged may include the dynamic parameters {1} and {2}, and the dynamic parameters {1} may be transferred to step s104 and the dynamic parameters {2} may be transferred to step s105 and processed.

Step s 104: the dynamic parameters determined to be yes in step s103 are searched for and recorded as similar dynamic parameters already configured, and the process proceeds to step s 130.

Step s 105: for the dynamic parameter determined as no in step s103, it is further determined whether the replacement content corresponding to the dynamic parameter can be called and acquired by accessing the upstream interface to which the current system has access, if yes, the process proceeds to step s107, and if no, the process proceeds to step s 106.

The upstream interface in the present invention includes but is not limited to: a user basic information interface, an order information interface, a user validity list interface and the like.

Step s 106: with respect to the dynamic parameters determined as no in step s106, it is further determined whether or not there is an unaccessed upstream interface that can acquire the substitute content corresponding to the dynamic parameters, and if yes, the process proceeds to step s120, and if no, the process proceeds to step s 110.

Step s 107: with respect to the dynamic parameters determined to be yes in step s105, it is further determined whether or not the corresponding dynamic parameters can be directly replaced with the replacement contents acquired from the upstream interface call. If the determination is no, it indicates that further processing of information is required for the replacement content, and the process proceeds to step s130, and if the determination is yes, it indicates that the corresponding dynamic parameter can be replaced with the replacement content called and acquired from the upstream interface, and the process proceeds to step s 120.

Step s 110: the dynamic parameter determined as no in step s106 is defined as a transparent transmission parameter, and the process proceeds to step s 140. The transparent parameters cannot be configured at this time. And calling a downstream system of the system to perform parameter direct transmission processing until the transparent transmission parameter configuration is finished.

Step s 120: the dynamic parameters determined to be yes in step s106 and the dynamic parameters determined to be yes in step s107 are defined as system-included parameters, and the process proceeds to step s 121. The replacement content corresponding to the system built-in parameter can be directly obtained by calling an upstream interface accessed by the system.

Step s 121: and if the system has accessed the upstream interface corresponding to the system built-in parameters, the step s122 is carried out, and if the system does not access the upstream interface corresponding to the system built-in parameters, the new interface is accessed, and then the step s122 is carried out. The new interface access processing is realized by encoding.

Step s 122: declaring the system built-in parameters, and determining the uniqueness of the replacement content acquired by the upstream interface accessed by the system and the system built-in parameters, and then, turning to step s 123. Step 122 may be explicitly unique by encoding, including for example enumeration, unique constant numbering, and the like.

Step s 123: and according to the uniqueness of the replacement content corresponding to the system built-in parameter in the step s122, designating a calling method for obtaining the replacement content corresponding to the system built-in parameter, and proceeding to a step s 140.

Based on step s123, the replacement content corresponding to each system built-in parameter can be subsequently obtained through the specified calling method, and the configuration of the system built-in parameter is ended. Step s123 may be implemented by encoding.

Step s 130: the dynamic parameters transferred to step s130 are defined as custom parameters, and then transferred to step s 131. The custom parameters can obtain the needed replacement contents through an upstream interface accessed by the system, but cannot be directly used for replacing the dynamic parameters, and further processing is needed.

Step s 131: configuring the dynamic parameters of step s130, where the configuration content includes: the pattern template and the dynamic parameter name are defined, and then step 132 is performed.

Step s 132: the analysis method is configured for the dynamic parameters defined in step s131, and the process proceeds to step s 140. The configuration analysis mode is realized by defining the reprocessed analysis code segment of the existing system built-in parameters and custom parameters, and the configuration of the custom parameters is finished.

And step s140, finishing the configuration, and outputting the configured file template and the configured dynamic parameters.

Fig. 3 is a schematic diagram of a main flow of converting dynamic parameters into dynamic documents according to an embodiment of the present invention, as shown in fig. 3, which may include:

step s 201: and (5) sequentially selecting and analyzing each dynamic parameter in the file template, acquiring the name of the dynamic parameter and a system analysis support parameter aiming at each dynamic parameter, recording the cycle number of analysis, and turning to the step s 210.

The system parsing support parameter refers to a parameter corresponding to the dynamic parameter and required when the replacement content is obtained, and includes, but is not limited to, a user name, a user provisioning period id, a user provisioning period category id, and the like.

Step s 210: it is determined whether or not each dynamic parameter is a parameter in the system, and if yes, the process proceeds to step s211, and if no, the process proceeds to step s 220.

In step 210, the uniqueness of the dynamic parameter name obtained by the analysis in step s201 is clarified, and it is determined whether or not a system-embedded parameter name having the same name exists in enumeration or a unique code, for example.

Step s 211: for the dynamic parameter determined to be the system-embedded parameter in step s202, the corresponding upstream interface is located, and then the process proceeds to step s 212.

The upstream interface corresponding to the system built-in parameter is already accessed to the system in the dynamic parameter configuration step 100, and the positioning can be implemented by means of pre-configuration, system scanning, reflection calling, or hard coding.

Step s 212: based on the name of the system built-in parameter, the system parsing support parameter and the corresponding calling method, the calling execution is performed, the required replacement content is obtained, and then the step s240 is performed.

In this step 212, the calling manner is relatively flexible, and for example, the calling may be performed by way of microservice, http, or the like.

Step s 220: with respect to the dynamic parameters determined as no in step s210, it is determined whether the dynamic parameters are the custom parameters, and if yes, the process proceeds to step s221, and if no, the process proceeds to step s 230. Determining whether the parameter is a custom parameter may be accomplished by determining whether a custom parameter configuration exists that is the same name as the dynamic parameter.

Step s 221: the analysis code determined to be the corresponding custom parameter in the obtaining step 220 is shifted to step s 222. The analysis code of the custom parameter is already configured in the dynamic parameter configuration step s100 and is directly obtained.

Step s 222: the name of the dynamic parameter (i.e. the name of the custom parameter in the step) obtained in step s201, the system parsing support parameter, and the parsing code obtained in step s220 are used to perform logic execution of the parsing code and obtain the executed replacement content, and then the process proceeds to step s240

Step s 230: the dynamic parameter determined as no in the determination step 220 is a transparent transmission parameter, and the process proceeds to step s 240. And the replacement content corresponding to the transparent transmission parameter is acquired by performing parameter transparent transmission when the replacement content is called from a downstream system.

Step s 240: respectively replacing each dynamic parameter with the corresponding replacement content according to the incoming dynamic parameter, the system analysis support parameter and the replacement content obtained in the steps s212, s221 and s230 to generate a replaced file, and then turning to the step s251

Step s 251: analyzing the generated file, judging whether other unanalyzed dynamic parameters exist, if so, going to step s252, and if not, going to step s253

Step s 252: it is determined whether the number of analysis cycles recorded in step s201 exceeds a set maximum value, and if yes, the process proceeds to step s260, and if no, the process proceeds to step s 201.

Step s 260: throw out the exception, do not export the case to the outside.

The reason why steps 251 to 260 are provided is that, in the process of creating a document by dynamic parameter processing, a new parameter may appear in a new document, and the new parameter is analyzed in the same manner, thereby enabling to cope with more complicated document contents. And in order to avoid the possibility of the occurrence of the endless loop processing, the definition of the number of loops is added in the process of analyzing all the files, and if the file analysis exceeds the specified number of loops, the file analysis process is automatically interrupted, and an exception is reported.

Step s 253: the execution of statements based on dynamic language or rule engine is forced to proceed to step s 254. Although it is determined in step 252 whether or not the generated document does not include any other unanalyzed dynamic parameters, this step 253 is performed in consideration of the possibility that an analysis code to be executed still exists.

Step s 254: and (4) judging whether the abnormality occurs or not, if so, turning to a step s255, and if not, turning to a step s 256.

Step s 255: the generated document is used as a final document, and the process proceeds to step s 257. The step 254 determines that an exception occurs, which means that the generated document has no code and does not have logic execution capability, so that the generated document can be directly used as a complete final document which can be pushed to the user.

Step s 256: the execution result of step s253 is transferred to step s257 as a final document. In step 254, it is determined that no exception has occurred, which indicates that the generated document has a code and is capable of logical execution, and therefore the result of executing a statement in the generated document by a dynamic language or a rule engine should be used as the final document.

Step s 257: and outputting the final file.

Fig. 4 is a schematic diagram of main modules of a document generation apparatus according to an embodiment of the present invention, and as shown in fig. 4, the document generation apparatus 400 includes a receiving module 401, an identifying module 402, and a processing module 403. The receiving module 401 receives a document generation request, and obtains a document template corresponding to the request. The identification module 502 obtains each dynamic parameter in the pattern template, and performs type identification on each dynamic parameter based on a preset first model. The generating module 403 respectively calls the corresponding second models to replace the parameter content according to the types of the dynamic parameters, so as to generate the document based on the document template.

In some embodiments, the identifying module 402 performs type identification on each dynamic parameter based on a preset first model, including:

judging whether the name of the dynamic parameter is the same as the name of the upstream interface access parameter or not;

if yes, identifying the type of the dynamic parameter as a system built-in parameter;

if not, judging whether the replacement content of the dynamic parameter is obtained by calling through a downstream interface, if so, identifying the type of the dynamic parameter as a transparent transmission parameter, and if not, identifying the type of the dynamic parameter as a self-defined parameter.

In some embodiments, the generating module 403 respectively invokes the corresponding second model to replace the parameter content according to the type of each dynamic parameter, including:

judging whether the type is a system built-in parameter or not according to the type of the dynamic parameter;

and if the type is the system built-in parameter, calling a second model corresponding to the system built-in parameter, further positioning a corresponding upstream interface, and acquiring the replacement content according to the name of the dynamic parameter so as to update the dynamic parameter.

In some embodiments, the generating module 403 respectively invokes the corresponding second model to replace the parameter content according to the type of each dynamic parameter, including:

judging whether the type is a user-defined parameter or not according to the type of the dynamic parameter;

if the type is the self-defined parameter, calling a second model corresponding to the self-defined parameter, further positioning a corresponding upstream interface, and acquiring the replacement content according to the interface parameter name corresponding to the dynamic parameter name; and carrying out logic processing on the replacement content based on preset analysis logic to obtain the processed replacement content so as to update the dynamic parameters.

In some embodiments, the generating module 403 performs logic processing on the replacement content based on preset parsing logic, including:

and executing preset parsing logic through a pre-configured dynamic language or a rule engine so as to perform logic processing on the replacement content.

In some embodiments, the generating module 403 respectively invokes the corresponding second model to replace the parameter content according to the type of each dynamic parameter, including:

judging whether the type is a transparent transmission parameter or not according to the type of the dynamic parameter;

and if the type is the transparent transmission parameter, calling a second model corresponding to the transparent transmission parameter, positioning a corresponding downstream interface, and acquiring the replacement content through the transparent transmission of the parameter so as to update the dynamic parameter.

In some embodiments, after the identifying module 402 identifies the type of each dynamic parameter based on the preset first model, the identifying module includes:

judging whether the type of the dynamic parameter is identified, if so, calling a corresponding second model to replace the parameter content according to the type of the dynamic parameter; if not, judging whether the cycle number of the currently identified dynamic parameter is greater than a preset number threshold, if so, not generating a file and outputting a request exception notification, otherwise, continuously identifying the type of the dynamic parameter.

It should be noted that the document creation method and the document creation device according to the present invention have corresponding relationships in the specific implementation contents, and therefore, the description of the repetitive contents is omitted.

Fig. 5 illustrates an exemplary system architecture 500 to which the pattern generation method of the touchdown system or the pattern generation apparatus of the touchdown system of embodiments of the invention may be applied.

As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.

The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).

The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.

The server 505 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 501, 502, 503. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.

It should be noted that the pattern generating method of the touchdown system provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the pattern generating apparatus of the touchdown system is generally disposed in the server 505.

It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.

Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.

As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.

The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.

In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.

It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, 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 the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. 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 or flowchart illustration, and combinations of blocks in the block diagrams 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 modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a receiving module, an identifying module, and a generating module. Wherein the names of the modules do not in some cases constitute a limitation of the module itself.

As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving a document generation request, and acquiring a document template corresponding to the request; acquiring each dynamic parameter in the file template, and identifying the type of each dynamic parameter based on a preset first model; and calling the corresponding second models respectively to replace the parameter content according to the types of the dynamic parameters so as to generate the file based on the file template.

According to the technical scheme of the embodiment of the invention, the dynamic parameters are classified and defined as the system built-in parameters, the self-defined parameters and the transparent parameters, and are configured and processed according to different dynamic parameter types, and different processing modes are adopted for different dynamic parameters, so that the code modification, joint debugging, testing and online processing are not required to be carried out on each dynamic parameter when the requirement of the touchable file changes, therefore, the problems of difficult management and low research and development efficiency of the dynamic parameters can be overcome, and the technical effects of improving the research and development efficiency and saving the research and development manpower are achieved.

The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种尺寸报告数据采集并结构化呈现的方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!