Disclosure of Invention
In order to solve the problems in the prior art, target data in content corresponding to a text template to be processed are extracted by obtaining the text template to be processed, the target data are inserted into a target data list, data in the target data list are traversed and compared with preset text configuration conditions to obtain a pure text as a target text, and then the target text is inserted into the text template to be processed; when the target text is the label text, the target text is matched with TiIs analyzed to obtain TiInserting the corresponding text tree structure and the target text corresponding to the text tree into the text template to be processed; the method can automatically generate the data according to the production link, and does not need a user to spend a large amount of time and energy on writing the text, thereby wasting resources and influencing the working efficiency of the user; the embodiment of the invention provides a text generation system based on production data. The technical scheme is as follows:
in one aspect, a system for generating text based on production data, the system comprising:
the database is used for storing a text template to be processed and a data list to be processed;
a memory for storing a text generation program based on production data;
a processor executing the production data based text generation program to implement the following process steps:
s101, acquiring a text template to be processed;
s103, extracting target data in the content corresponding to the text template to be processed, and inserting the target data into a target data list S = (S)1,S2,S3,……,Sm) In, SiI =1 … … m, where m is the number of target data;
s105, traversing S and when SiWhen the corresponding preset text configuration condition is met, S is obtainediCorresponding target text vector T = (T)1,T2,T3,……,Tm) Wherein, TiMeans SiA corresponding target text;
s107, when TiFor plain text, then T isiInserting the text template to be processed into the text template to be processed;
s109, when T isiFor label text, then pair TiIs analyzed to obtain TiCorresponding text tree structure and text
Target text B corresponding to treeiAnd B isiAnd inserting the text template into the text template to be processed.
The text generation system based on the production data has the following technical effects:
according to the method, a text template to be processed is obtained, target data in content corresponding to the text template to be processed are extracted, the target data are inserted into a target data list, data in the target data list are traversed and compared with preset text configuration conditions, the target text is obtained to be a plain text, and then the target text is inserted into the text template to be processed; when the target text is the label text, the target text is matched with TiIs analyzed to obtain TiInserting the corresponding text tree structure and the target text corresponding to the text tree into the text template to be processed; the method can automatically generate the data according to the production link, and does not need a user to spend a large amount of time and energy on writing the text, thereby wasting resources and influencing the working efficiency of the user;
meanwhile, the system acquires a data set to be processed, performs field extraction on any data list to be processed, maps the extracted fields to a target field list, and inserts a target variable list into a target formula to obtain a target data list, wherein the target variable list comprises the target field list or other data lists corresponding to the target field list, different data required by a user can be accurately calculated, the target variable list is used for monitoring a production system, and meanwhile, the incidence relation among variable data is also considered, so that the influence on the calculation of other data is avoided when a plug-in corresponding to any data is abnormal.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
This embodiment provides a text generation system based on production data, the system includes:
the database is used for storing a text template to be processed and a data list to be processed;
a memory for storing a text generation program based on production data;
a processor executing the production data based text generation program to implement the following process steps as shown in FIG. 1:
s101, acquiring a text template to be processed;
s103, extracting target data in the content corresponding to the text template to be processed, and inserting the target data into a target data list S = (S)1,S2,S3,……,Sm) In, SiI =1 … … m, where m is the number of target data.
Specifically, S is ordered according to the order of appearance in the target data, e.g., S1Has precedence over S2The text template to be processed is generated according to the sequence, and the generation of abnormal texts caused by omission or sequence disorder is avoided.
Specifically, the target data is first data or second data, the first data refers to a physical quantity in a to-be-processed data list, and the second data refers to data obtained by calculating the first data through a target formula.
In a specific embodiment, the system further includes a first data module, where the first data module is configured to determine the to-be-processed data list, as shown in fig. 2, the specific steps are as follows:
s201, acquiring a target plug-in ID set C = (C)1,C2,C3,……,Cz),CpThe method refers to a logic node list corresponding to the p-th target plug-in ID, wherein p =1 … … z, and z is the number of target plug-ins;
s203, aiming at z C according to the flow point corresponding to the target servicepConfiguring to obtain a target node list D = (D)1,D2,D3,……Dn) To provide the target service based on D, wherein DjJ =1 … … n, wherein n is the number of target nodes;
s205, in the process that D provides the target service, D is processedjInserting the generated data into AjAnd obtaining a data set A = (A) to be processed1,A2,A3,……,An),AjIs referred to as DjAnd (4) corresponding to-be-processed data lists.
Specifically, the target plug-in refers to a program providing one or more services.
Furthermore, the target plug-in can be independently deployed on any one server, the server can be a local server, a private cloud server or a public cloud server, the number of the servers is at least z, and the value range of z is 10-20; wherein, preferably, z is 10.
Specifically, the target node is a logic node that executes a flow point corresponding to a target service, and the target node corresponds to the flow point corresponding to the target service one to one, where the logic node is a program that executes the flow point in the service, and the logic node cannot be deployed in an independent server alone, so that a barrier between different logic nodes can be eliminated, communication connection is improved, and efficient service improvement is facilitated.
Further, D is determined using the following conditions:
obtaining Aj=(Aj1,Aj2,Aj3,……,Ajs) Wherein A isjrThe number of the r-th logical node is defined, r =1 … … s, and s is the number of the logical nodes;
initialization D = Null traversal aj;
When A isjrThe name of the corresponding code packet is consistent with the name of the process point corresponding to the execution of the target service, and A is compared with AjrInsert into D.
Further, n satisfies the following condition:
wherein, Y
XRefers to the X number A
jCorresponding target node number and Y
XS is not more than s, the value range of s is 10-100, preferably s is 50, w is A corresponding to D
jrAnd w is less than or equal to z.
In a practical application, when the target service is provided and interaction among a plurality of target plug-ins is required, namely when X is more than or equal to 2, according to the flow point corresponding to the target service, a plurality of W A are processediIs carried out and either AjComprising YXA isjrRunning s logical nodes to provide the target service; different services can be provided through interaction among different target plug-ins, a corresponding target plug-in does not need to be installed for each newly added service, the number of the target plug-ins and the load of a processor are reduced, and meanwhile, the waste of resources and the enrichment of service projects of enterprises are avoided;
meanwhile, due to interaction among the target plug-ins, data of the association relation are updated at the same time, calculation of intermediate data is not needed, calculation errors caused by secondary calculation and calculation errors caused by the fact that certain data are not updated timely can be avoided, and calculation accuracy is improved.
Specifically, the type corresponding to the data to be processed is an integer type, a text type, or a boolean type, and preferably, the type corresponding to the data to be processed is an integer type.
In a specific embodiment, the system further includes a second data module, where the second data module is configured to determine a second data list, as shown in fig. 3, the specific steps are as follows:
s301, extracting any AiThe field corresponding to the physical quantity is sampled.
Specifically, the to-be-processed data list refers to a list of industrial data stored in the target node, where the industrial data includes: the sampling physical quantity, the sampling time corresponding to the sampling physical quantity and the equipment name corresponding to the sampling physical quantity are one or more combinations, and preferentially, the industrial data comprises the sampling physical quantity value.
S303, mapping the field corresponding to the sampling physical quantity to a target field list H = (H)1,H2,H3,……,Hn) In which H isjMeans AjThe corresponding target field.
Specifically, A1To Aj-1Wherein one or more to-be-processed data lists are stored in DjIn the corresponding target node, the problem that the target node cannot provide services due to abnormal conditions of other target nodes or data abnormal conditions generated when the plug-in is configured to other servers can be avoided.
S305, inserting a target variable list into a target formula to obtain a second data list, wherein the target variable list comprises HjOr HjA corresponding data list.
In particular, HjThe corresponding data list is denoted HjAnd calculating the data list by other target formulas by adopting the same steps of S301-S305, and the description is omitted here.
Specifically, the target formula is according to a target symbol list E and a target function list
And configuring a formula according to a preset rule.
Further, E = (E)1,E2,E3,……,Eλ) Wherein E isαRefers to the alpha-th physical symbol, alpha =1 … … lambda, lambda being the number of physical symbols.
Further, the air conditioner is provided with a fan,
wherein
refers to the beta-th calculation function, where beta =1 … … gamma, and gamma is the number of calculation functions.
In a specific embodiment, the target service number G1 interactively provided by a plurality of target plug-ins is not greater than the target service number G2 provided by a single target plug-in, the value range of G1+ G2 is 10-100, and preferably, G1+ G2 is 50.
In a specific embodiment, the system further includes an API interface corresponding to the target plug-in, the API interface is in communication connection with other servers, and the API interface is used for providing target services through the target plug-in, and can ensure direct interaction of different servers, so as to complete provision of multiple services and enrich enterprise services.
S105, traversing S and when SiWhen the corresponding preset text configuration condition is met, S is obtainediCorresponding target text vector T = (T)1,T2,T3,……,Tm) Wherein, TiMeans SiThe corresponding target text.
Specifically, the preset text configuration condition includes a plurality of conditions, for example, when S is
iGenerating corresponding T when the threshold value is greater than a preset threshold value
iWhen S is
iLess than or equal to the preset threshold value, generating corresponding
,T
iAnd
are different; or, S
iWhen the signal is in the first preset range, generating correspondenceT of
i,S
iWhen in the second preset range, generating corresponding
,T
iAnd
the first preset range and the second preset range are different; wherein,
is also referred to as S
iA corresponding target text; the method can generate various text contents conveniently according to different physical quantities, and meets various requirements of users.
S107, when TiFor plain text, then T isiInserting the text template to be processed into the text template to be processed;
in particular, the plain text refers to text in the text content without a field identifying the calculation identifier.
S109, when T isiFor label text, then pair TiIs analyzed to obtain TiCorresponding text tree structure and corresponding non-plain text B of text treeiAnd B isiAnd inserting the text template into the text template to be processed.
Specifically, the tag text refers to text with a calculation identifier field in text content, and the calculation identifier may be an if identifier or other identifier.
Specifically, BiCorresponding tag text list B = (B)1,B2,B3,……,Bm)。
In a specific embodiment, S109 further includes:
s1091, acquiring a data set F = (F) corresponding to the text tree1,F2,F3,……,Fg),FtThe method is characterized by comprising the following steps of (1) indicating a data list corresponding to a t-th layer, wherein t =1 … … g, and g is the level of a text tree;
s1093, traverse FtAnd FtCorresponding text list insertion to Ft-1Corresponding toIn the text template, F is obtainedt-1A corresponding text list;
repeat S1093 step and traverse F until t =1, let F2Corresponding text insertion into Ft-1In the corresponding text template, B is obtainediWherein F isgThe corresponding text is plain text, e.g. when g =3, F3Corresponding text list insertion F2In the corresponding text template, F is obtained2Corresponding text list, and then F2Corresponding text list insertion to F1In the corresponding text template, B is obtainediAccording to BiAnd inserting the corresponding label text list B into the text template to be processed to generate a required text.
Specifically, the order of traversing F is in the order of the leaf nodes of the text tree structure to the root node of the text tree structure, i.e., from FnTo F1The direction of the target text is traversed, so that the target text can be generated quickly, and the abnormal text generated due to omission is prevented.
Specifically, Ft+1Corresponding text and FtNested relationships between corresponding text, e.g. FtThe corresponding text contains Ft+1。
The embodiment provides a text generation system based on production data, which extracts target data in content corresponding to a text template to be processed by acquiring the text template to be processed, inserts the target data into a target data list, traverses data in the target data list and compares the data with preset text configuration conditions to obtain a plain text of a target text, and inserts the target text into the text template to be processed; when the target text is the label text, the target text is matched with TiIs analyzed to obtain TiInserting the corresponding text tree structure and the target text corresponding to the text tree into the text template to be processed; the method can automatically generate the data according to the production link, and does not need a user to spend a large amount of time and energy on writing the text, thereby wasting resources and influencing the working efficiency of the user;
meanwhile, the system acquires a data set to be processed, performs field extraction on any data list to be processed, maps the extracted fields to a target field list, and inserts a target variable list into a target formula to obtain a target data list, wherein the target variable list comprises the target field list or other data lists corresponding to the target field list, different data required by a user can be accurately calculated, the target variable list is used for monitoring a production system, and meanwhile, the incidence relation among variable data is also considered, so that the influence on the calculation of other data is avoided when a plug-in corresponding to any data is abnormal.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.