CN109683856A - Electronic device, Faas stage function creation method and storage medium - Google Patents
Electronic device, Faas stage function creation method and storage medium Download PDFInfo
- Publication number
- CN109683856A CN109683856A CN201811255121.5A CN201811255121A CN109683856A CN 109683856 A CN109683856 A CN 109683856A CN 201811255121 A CN201811255121 A CN 201811255121A CN 109683856 A CN109683856 A CN 109683856A
- Authority
- CN
- China
- Prior art keywords
- function
- title
- parameter
- faas
- array
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 28
- 230000006978 adaptation Effects 0.000 claims abstract description 13
- 230000006870 function Effects 0.000 claims description 536
- 238000012545 processing Methods 0.000 claims description 7
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 241000208340 Araliaceae Species 0.000 description 2
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 2
- 235000003140 Panax quinquefolius Nutrition 0.000 description 2
- 235000008434 ginseng Nutrition 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 230000005236 sound signal Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/22—Procedural
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/016—Input arrangements with force or tactile feedback as computer generated output to the user
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Human Computer Interaction (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Stored Programmes (AREA)
Abstract
The present invention relates to cloud deployment, propose a kind of Faas stage function creation method, and the first function information of the first function created on Fass platform is needed including determining;The title and first function parameter of first function are determined according to first function information;The title of the first function and first function parameter are matched with the title of each function in the Function Array of pre-stored preset format and function parameter;If thering is the corresponding second function title of second function and second function parameter with the first function title and the first function parameter successful match, to obtain the source code of the second function in the Function Array;Source code based on the second function carries out adaptation, to generate the first function.It can be improved the utilization rate of Fass platform management resource, and a large amount of human cost of enterprise can be saved, improve function creation efficiency.The present invention also proposes a kind of electronic device and storage medium.
Description
Technical field
The present invention relates to cloud service field more particularly to a kind of electronic devices, Faas stage function creation method and storage
Medium.
Background technique
With the continuous development of cloud, more and more cloud platforms start to provide business service towards various enterprises.Mesh
Before, in cloud service field, when providing business service towards various enterprises by Faas, each enterprise is needed to upload self-built function
It is managed collectively into Faas.But usually exist between same service field, such as financial field, each enterprise big
Identical business demand is measured, is easy to appear between enterprise and repeats to upload identical function to Faas platform, it is flat not only result in Faas
The management wasting of resources of platform, and waste the inefficiency of a large amount of manpower financial capacity of enterprise, function creation.
Summary of the invention
In view of this, the present invention proposes a kind of electronic device, Faas stage function creation method and storage medium, Neng Gouti
The utilization rate of high Fass platform management resource, and a large amount of human cost of enterprise can be saved, improve function creation efficiency.
Firstly, to achieve the above object, the present invention proposes a kind of electronic device, the electronic device include memory and
The processor connecting with the memory, the processor are used to execute the Faas stage function creation stored on the memory
Program, the Faas stage function creation program realize following steps when being executed by the processor:
A1, the first function information for needing the first function created on Fass platform is determined;
A2, the title and first function parameter that first function is determined according to first function information;
A3, will be in the Function Array of the title of the first function and first function parameter and pre-stored preset format
Each function title and function parameter matched;
If have in A4, the Function Array the corresponding second function title of second function and second function parameter with it is described
First function title and the first function parameter successful match, then obtain the source code of the second function;
A5, the source code based on the second function carry out adaptation, to generate the first function.
Preferably, in the step A1, the first function information includes calling type of service, the volume of function of function
The function of Cheng Yuyan and function.
Preferably, in the step A2, the title of the first function includes the corresponding class name of the first function,
Wherein, a class includes multiple functions or multiple classes include the same function;
The first function parameter includes the parameter of first function input and the implementing result of first function.
It preferably, further include the generation step of the Function Array of pre-stored preset format before the step A3,
The step of generation of the Function Array of the pre-stored preset format includes:
The function of the first predefined quantity is obtained from the Faas platform;
According to predetermined function similarity analysis rule, analyze respectively each in the function of the described first predefined quantity
Similarity between function;
If there is the similarity between function and the function of the second predefined quantity to be greater than preset similarity threshold, it is based on
The title and function parameter of the function of the function generate the Function Array of the preset format, the Function Array of the preset format
In include function similar with the function.
Preferably, the title of the first function and first function parameter are indicated with bytecode, the preset format
The title and function parameter of each function in Function Array indicate that the predetermined function similarity is divided also with bytecode
Analysing rule includes:
Judge the length of the bytecode of each function of the described first predefined quantity indicated with bytecode;
If there is the bytecode of function to be less than or equal to the first preset length, the function is deleted;
If there is the bytecode of function to be greater than the first preset length, the word of the second preset length in the function byte code is intercepted
Save sample set information of the code as the function;
Cartesian product is done to each sample set information of interception respectively and deletes the duplicate keys after cartesian product, is obtained by owning
The function pair that the function for including in sample set information is constituted;
All functions pair obtained are traversed, determine the longest common subsequence of each function pair of composition;
To each function pair, the length of determining longest common subsequence and the length of sample set information are calculated separately
Ratio, will calculate obtain ratio as the similarity value of function pair.
In addition, to achieve the goals above, the present invention also proposes a kind of Faas stage function creation method, the method packet
Include following steps:
S1, the first function information for needing the first function created on Fass platform is determined;
S2, the title and first function parameter that first function is determined according to first function information;
S3, will be in the Function Array of the title of the first function and first function parameter and pre-stored preset format
Each function title and function parameter matched;
If have in S4, the Function Array the corresponding second function title of second function and second function parameter with it is described
First function title and the first function parameter successful match, then obtain the source code of the second function;
S5, the source code based on the second function carry out adaptation, to generate the first function.
Preferably, in the step S1, the first function information includes calling type of service, the volume of function of function
The function of Cheng Yuyan and function.
Preferably, in the step S2, the title of the first function includes the corresponding class name of the first function,
Wherein, a class includes multiple functions or multiple classes include the same function;
The first function parameter includes the parameter of first function input and the implementing result of first function.
It preferably, further include the generation step of the Function Array of pre-stored preset format before the step S3,
The step of generation of the Function Array of the pre-stored preset format includes:
The function of the first predefined quantity is obtained from the Faas platform;
According to predetermined function similarity analysis rule, analyze respectively each in the function of the described first predefined quantity
Similarity between function;
If there is the similarity between function and the function of the second predefined quantity to be greater than preset similarity threshold, it is based on
The title and function parameter of the function of the function generate the Function Array of the preset format, the Function Array of the preset format
In include function similar with the function.
In addition, to achieve the above object, the present invention also proposes a kind of computer readable storage medium, described computer-readable
Storage medium is stored with Faas stage function creation program, and the Faas stage function creation program can be by least one processor
It executes, so that the step of at least one described processor executes Faas stage function creation method as described above.
Electronic device, Faas stage function creation method and storage medium proposed by the invention is needed by determining
The first function information of the first function created on Fass platform;The title and of first function is determined according to first function information
One function parameter;It will be in the Function Array of the title of the first function and first function parameter and pre-stored preset format
Each function title and function parameter matched;If there is the corresponding second function title of second function in the Function Array
And second function parameter then obtains the second function with the first function title and the first function parameter successful match
Source code;Source code based on the second function carries out adaptation, to generate the first function.It can be improved Fass
The utilization rate of platform management resource, and a large amount of human cost of enterprise can be saved, improve function creation efficiency.
Detailed description of the invention
Fig. 1 is the schematic diagram of the optional hardware structure of electronic device one proposed by the present invention;
Fig. 2 is the program module schematic diagram that Faas stage function creates in one embodiment of electronic device of the present invention;
Fig. 3 is the implementation flow chart of Faas stage function creation method preferred embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not
For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work
Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
It should be noted that the description for being related to " first ", " second " etc. in the present invention is used for description purposes only, and cannot
It is interpreted as its relative importance of indication or suggestion or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the
One ", the feature of " second " can explicitly or implicitly include at least one of the features.In addition, the skill between each embodiment
Art scheme can be combined with each other, but must be based on can be realized by those of ordinary skill in the art, when technical solution
Will be understood that the combination of this technical solution is not present in conjunction with there is conflicting or cannot achieve when, also not the present invention claims
Protection scope within.
As shown in fig.1, being the optional hardware structure schematic diagram of electronic device one proposed by the present invention.In the present embodiment,
Electronic device 10 may include, but be not limited only to, and connection memory 11, processor 12, net can be in communication with each other by communication bus 14
Network interface 13.It should be pointed out that Fig. 1 illustrates only the electronic device 10 with component 11-14, it should be understood that simultaneously
All components shown realistic are not applied, the implementation that can be substituted is more or less component.
Wherein, memory 11 includes at least a type of computer readable storage medium, computer readable storage medium
Including flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), quiet
State random access storage device (SRAM), electrically erasable programmable read-only memory (EEPROM), can be compiled read-only memory (ROM)
Journey read-only memory (PROM), magnetic storage, disk, CD etc..In some embodiments, memory 11 can be electronics dress
Set 10 internal storage unit, such as the hard disk or memory of electronic device 10.In further embodiments, memory 11 can also be with
It is the outer packet storage device of electronic device 10, such as the plug-in type hard disk being equipped on electronic device 10, intelligent memory card (Smart
Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Certainly, it stores
Device 11 can also both including electronic device 10 internal storage unit and also including its outer packet storage device.In the present embodiment, storage
Device 11 is installed on the operating system and types of applications software of electronic device 10, such as the creation of Faas stage function commonly used in storage
Program etc..In addition, memory 11 can be also used for temporarily storing the Various types of data that has exported or will export.
Processor 12 can be in some embodiments central processing unit (Central Processing Unit, CPU),
Controller, microcontroller, microprocessor or other data processing chips.Processor 12 is commonly used in control electronic device 10
Overall operation.In the present embodiment, program code or processing data of the processor 12 for being stored in run memory 11, such as
Faas stage function creation program of operation etc..
Network interface 13 may include radio network interface or wired network interface, and network interface 13 is commonly used in filling in electronics
It sets and establishes communication connection between 10 and other electronic equipments.
Communication bus 14 is for realizing the communication connection between component 11-13.
Fig. 1 illustrates only the electronic device 10 with the creation of component 11-14 and Faas stage function, it should be understood that
It is, it is not required that implement all components shown, the implementation that can be substituted is more or less component.
Optionally, electronic device 10 can also include user interface (not shown in figure 1), and user interface may include display
Device, input unit such as keyboard, wherein user interface can also be including standard wireline interface and wireless interface etc..
Optionally, in some embodiments, display can be light-emitting diode display, liquid crystal display, touch control type LCD and show
Device and OLED touch device etc..Further, display is alternatively referred to as display screen or display unit, for being shown in electronic device
Information is handled in 10 and for showing visual user interface.
Optionally, in some embodiments, electronic device 10 can also include that audio unit (does not show in audio unit Fig. 1
Out), audio unit can be in call signal reception pattern, call mode, logging mode, speech recognition mould in electronic device 10
When under the isotypes such as formula, broadcast reception mode, received or storage audio data is converted into audio signal;Further
Ground, electronic device 10 can also include audio output unit, and the audio signal that audio output unit converts audio unit exports,
And audio output unit can also provide the relevant audio output of specific function that executes to electronic device 10 (such as calling is believed
Number receive sound, message sink sound etc.), audio output unit may include loudspeaker, buzzer etc..
Optionally, in some embodiments, electronic device 10 can also include alarm unit (not shown), alarm list
Member can provide output and the generation of event is notified electron device 10.Typical event may include calling reception, message
Reception, key signals input, touch input etc..Other than audio or video export, alarm unit can be with different sides
Formula provides output with the generation of notification event.For example, alarm unit can provide output in the form of vibration, exhaled when receiving
Cry, message or it is some other can make electronic device 10 enter communication pattern when, alarm unit can provide tactile output (that is,
Vibration) to notify to user.
In one embodiment, it is real when the Faas stage function creation program stored in memory 11 is executed by processor 12
Now following operation:
A1 determines the first function information for needing the first function created on Fass platform;
Specifically, the FaaS is the abbreviation of Functions as a Service, can be interpreted as function clothes with broad sense
Businessization can also be construed to function service.When using Faas, service code logic only need to be paid close attention to, without paying close attention to server
Resource, so Faas is closely related without paying close attention to server S erverless with developer.It is possible to further which Faas is understood
It, can be using function as an online service, remote when using Faas for the event-driven framework based on code function
Journey calculates service, can be executed by API, executed by mail, be executed by Iot, executed by queue etc..Therefore, it will create
The function built is uploaded to Faas platform, is the key point of Faas platform architecture.
In the present embodiment, the first function of Faas platform is if desired created, it is determined that the first function of the first function
Information, specifically, the first function information include the type of service of calling function, such as type of service, the card of banking system
Type of service, the type of service of insurance system, type of service of trust system of certificate system etc., the programming language of function, such as
The assembler languages such as Python, nodejs, Java, the function of function, such as picture processing, application program Acti auditing, data school
It tests, data screening etc..
A2 determines the title and first function parameter of first function according to first function information;
As an alternative embodiment, the title of the first function includes the corresponding class name of the first function
Claim.Wherein, function name can include but is not limited to: the title of animation function, the title of interface renewal function, renewal time letter
The title etc. of the function of breath.It is understood that a class may include multiple functions, multiple classes may include the same letter
Number.Specifically, the first function parameter includes the parameter of first function input and the implementing result of first function.
A3, will be in the Function Array of the title of the first function and first function parameter and pre-stored preset format
Each function title and function parameter matched;
Specifically, the Function Array of the preset format can be, such as: { name: " calling function name ", param: " defeated
The function parameter entered ", result: " result that this function executes " }, the Function Array of the pre-stored preset format
Generating process includes the following steps:
The function of the first predefined quantity is obtained from the Faas platform;
According to predetermined function similarity analysis rule, analyze respectively each in the function of the described first predefined quantity
Similarity between function;
If there is the similarity between function and the function of the second predefined quantity to be greater than preset similarity threshold, it is based on
The title and function parameter of the function of the function generate the Function Array of the preset format, the Function Array of the preset format
In include function similar with the function.
Specifically, the title of the first function and first function parameter are indicated with bytecode, the preset format
The title and function parameter of each function in Function Array indicate that the predetermined function similarity is divided also with bytecode
Analysing rule includes:
Judge the length of the bytecode of each function of the described first predefined quantity indicated with bytecode;
If there is the bytecode of function to be less than or equal to the first preset length, the function is deleted;
If there is the bytecode of function to be greater than the first preset length, the word of the second preset length in the function byte code is intercepted
Save sample set information of the code as the function;
Cartesian product is done to each sample set information of interception respectively and deletes the duplicate keys after cartesian product, is obtained by owning
The function pair that the function for including in sample set information is constituted;
All functions pair obtained are traversed, determine the longest common subsequence of each function pair of composition;
To each function pair, the length of determining longest common subsequence and the length of sample set information are calculated separately
Ratio, will calculate obtain ratio as the similarity value of function pair.
A4, if having in the Function Array the corresponding second function title of second function and second function parameter with it is described
First function title and the first function parameter successful match, then obtain the source code of the second function;
A5, the source code based on the second function carries out adaptation, to generate the first function.
By above-mentioned thing embodiment it is found that electronic device proposed by the present invention, needs to create on Fass platform by determining
First function first function information;The title and first function parameter of first function are determined according to first function information;It will
The name of each function in the title and first function parameter of the first function and the Function Array of pre-stored preset format
Claim and function parameter is matched;If having the corresponding second function title of second function and second function ginseng in the Function Array
Number then obtains the source code of the second function with the first function title and the first function parameter successful match;Base
Adaptation is carried out in the source code of the second function, to generate the first function.It can be improved Fass platform management money
The utilization rate in source, and a large amount of human cost of enterprise can be saved, improve function creation efficiency.
In addition, the function that Faas stage function creation of the invention is realized according to its each section is different, it can be with phase
The program module of congenerous is described.It please refers to shown in Fig. 2, is Faas stage function in one embodiment of electronic device of the present invention
The program module schematic diagram of creation.In the present embodiment, the function that the creation of Faas stage function is realized according to its each section is not
Together, the first determining module 201 can be divided into, the second determining module 202, matching module 203, obtain module 204 and life
At module 205.By above description it is found that the so-called program module of the present invention is a series of meters for referring to complete specific function
Calculation machine program instruction section, the execution than program more suitable for description Faas stage function creation program in electronic device 10
Journey.The functions or operations step that the module 201-205 is realized is similar as above, and and will not be described here in detail, illustratively, example
As wherein:
First determining module 201 needs the first function information of the first function created on Fass platform for determining;
Second determining module 202 is used to determine the title and first function parameter of first function according to first function information;
Matching module 203 is used for the title of the first function and first function parameter and pre-stored preset format
Function Array in each function title and function parameter matched;
If obtaining module 204 for having the corresponding second function title of second function and the second letter in the Function Array
Number parameter then obtains the source generation of the second function with the first function title and the first function parameter successful match
Code;
Generation module 205 carries out adaptation for the source code based on the second function, to generate first letter
Number.
In addition, the present invention also proposes a kind of Faas stage function creation method, please refer to shown in Fig. 3, the Faas platform
Function creation method includes the following steps:
S301 determines the first function information for needing the first function created on Fass platform;
Specifically, the FaaS is the abbreviation of Functions as a Service, can be interpreted as function clothes with broad sense
Businessization can also be construed to function service.When using Faas, service code logic only need to be paid close attention to, without paying close attention to server
Resource, so Faas is closely related without paying close attention to server S erverless with developer.It is possible to further which Faas is understood
It, can be using function as an online service, remote when using Faas for the event-driven framework based on code function
Journey calculates service, can be executed by API, executed by mail, be executed by Iot, executed by queue etc..Therefore, it will create
The function built is uploaded to Faas platform, is the key point of Faas platform architecture.
In the present embodiment, the first function of Faas platform is if desired created, it is determined that the first function of the first function
Information, specifically, the first function information include the type of service of calling function, such as type of service, the card of banking system
Type of service, the type of service of insurance system, type of service of trust system of certificate system etc., the programming language of function, such as
The assembler languages such as Python, nodejs, Java, the function of function, such as picture processing, application program Acti auditing, data school
It tests, data screening etc..
S302 determines the title and first function parameter of first function according to first function information;
As an alternative embodiment, the title of the first function includes the corresponding class name of the first function
Claim.Wherein, function name can include but is not limited to: the title of animation function, the title of interface renewal function, renewal time letter
The title etc. of the function of breath.It is understood that a class may include multiple functions, multiple classes may include the same letter
Number.Specifically, the first function parameter includes the parameter of first function input and the implementing result of first function.
S303, by the Function Array of the title of the first function and first function parameter and pre-stored preset format
In each function title and function parameter matched;
Specifically, the Function Array of the preset format can be, such as: { name: " calling function name ", param: " defeated
The function parameter entered ", result: " result that this function executes " }, the Function Array of the pre-stored preset format
Generating process includes the following steps:
The function of the first predefined quantity is obtained from the Faas platform;
According to predetermined function similarity analysis rule, analyze respectively each in the function of the described first predefined quantity
Similarity between function;
If there is the similarity between function and the function of the second predefined quantity to be greater than preset similarity threshold, it is based on
The title and function parameter of the function of the function generate the Function Array of the preset format, the Function Array of the preset format
In include function similar with the function.
Specifically, the title of the first function and first function parameter are indicated with bytecode, the preset format
The title and function parameter of each function in Function Array indicate that the predetermined function similarity is divided also with bytecode
Analysing rule includes:
Judge the length of the bytecode of each function of the described first predefined quantity indicated with bytecode;
If there is the bytecode of function to be less than or equal to the first preset length, the function is deleted;
If there is the bytecode of function to be greater than the first preset length, the word of the second preset length in the function byte code is intercepted
Save sample set information of the code as the function;
Cartesian product is done to each sample set information of interception respectively and deletes the duplicate keys after cartesian product, is obtained by owning
The function pair that the function for including in sample set information is constituted;
All functions pair obtained are traversed, determine the longest common subsequence of each function pair of composition;
To each function pair, the length of determining longest common subsequence and the length of sample set information are calculated separately
Ratio, will calculate obtain ratio as the similarity value of function pair.
S304, if having the corresponding second function title of second function and second function parameter in the Function Array and institute
First function title and the first function parameter successful match are stated, then obtains the source code of the second function;
S305, the source code based on the second function carries out adaptation, to generate the first function.
By above-mentioned thing embodiment it is found that Faas stage function creation method proposed by the present invention, is needed by determining
The first function information of the first function created on Fass platform;The title and of first function is determined according to first function information
One function parameter;It will be in the Function Array of the title of the first function and first function parameter and pre-stored preset format
Each function title and function parameter matched;If there is the corresponding second function title of second function in the Function Array
And second function parameter then obtains the second function with the first function title and the first function parameter successful match
Source code;Source code based on the second function carries out adaptation, to generate the first function.It can be improved Fass
The utilization rate of platform management resource, and a large amount of human cost of enterprise can be saved, improve function creation efficiency.
In addition, the present invention also proposes a kind of computer readable storage medium, stored on the computer readable storage medium
There is Faas stage function to create program, the Faas stage function creation program realizes following operation when being executed by processor:
Determine the first function information for needing the first function created on Fass platform;
The title and first function parameter of first function are determined according to first function information;
It will be in the Function Array of the title of the first function and first function parameter and pre-stored preset format
The title and function parameter of each function are matched;
If having the corresponding second function title of second function and second function parameter with described in the Function Array
One function name and the first function parameter successful match, then obtain the source code of the second function;
Source code based on the second function carries out adaptation, to generate the first function.
The specific implementation process of computer readable storage medium of the present invention, with above-mentioned electronic device and Faas stage function
The specific implementation process of creation method is similar, and details are not described herein.
By above-mentioned fact Example it is found that storage medium proposed by the present invention, needs to create on Fass platform by determining
First function first function information;The title and first function parameter of first function are determined according to first function information;It will
The name of each function in the title and first function parameter of the first function and the Function Array of pre-stored preset format
Claim and function parameter is matched;If having the corresponding second function title of second function and second function ginseng in the Function Array
Number then obtains the source code of the second function with the first function title and the first function parameter successful match;Base
Adaptation is carried out in the source code of the second function, to generate the first function.It can be improved Fass platform management money
The utilization rate in source, and a large amount of human cost of enterprise can be saved, improve function creation efficiency.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes
Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.The above is only of the invention excellent
Embodiment is selected, is not intended to limit the scope of the invention, it is all using made by description of the invention and accompanying drawing content etc.
Structure or equivalent process transformation are imitated, is applied directly or indirectly in other relevant technical fields, and is similarly included in the present invention
Scope of patent protection in.
Claims (10)
1. a kind of electronic device, which is characterized in that the electronic device includes memory and the processing that connect with the memory
Device, the processor are used to execute the Faas stage function creation program stored on the memory, the Faas stage function
Creation program realizes following steps when being executed by the processor:
A1, the first function information for needing the first function created on Fass platform is determined;
A2, the title and first function parameter that first function is determined according to first function information;
A3, by the title of the first function and first function parameter with it is each in the Function Array of pre-stored preset format
The title and function parameter of function are matched;
If having the corresponding second function title of second function and second function parameter with described first in A4, the Function Array
Function name and the first function parameter successful match, then obtain the source code of the second function;
A5, the source code based on the second function carry out adaptation, to generate the first function.
2. electronic device as described in claim 1, which is characterized in that in the step A1, the first function packet
Include type of service, the programming language of function and the function of function for calling function.
3. electronic device as described in claim 1, which is characterized in that in the step A2, the title of the first function
Including the corresponding class name of the first function, wherein a class includes multiple functions or multiple classes include the same letter
Number;
The first function parameter includes the parameter of first function input and the implementing result of first function.
4. electronic device as described in claim 1, which is characterized in that further include pre-stored before the step A3
The step of generation step of the Function Array of preset format, the generation of the Function Array of the pre-stored preset format, wraps
It includes:
The function of the first predefined quantity is obtained from the Faas platform;
According to predetermined function similarity analysis rule, each function in the function of the described first predefined quantity is analyzed respectively
Between similarity;
If there is the similarity between function and the function of the second predefined quantity to be greater than preset similarity threshold, it is based on the letter
The title and function parameter of several functions generate the Function Array of the preset format, wrap in the Function Array of the preset format
Include function similar with the function.
5. electronic device as claimed in claim 4, which is characterized in that the title and first function parameter of the first function are equal
It is indicated with bytecode, the title and function parameter of each function in the Function Array of the preset format are also with byte code table
Show, the predetermined function similarity analysis rule includes:
Judge the length of the bytecode of each function of the described first predefined quantity indicated with bytecode;
If there is the bytecode of function to be less than or equal to the first preset length, the function is deleted;
If there is the bytecode of function to be greater than the first preset length, the bytecode of the second preset length in the function byte code is intercepted
Sample set information as the function;
Cartesian product is done to each sample set information of interception respectively and deletes the duplicate keys after cartesian product, is obtained by all samples
The function pair that the function for including in collection information is constituted;
All functions pair obtained are traversed, determine the longest common subsequence of each function pair of composition;
To each function pair, the ratio of the length of determining longest common subsequence and the length of sample set information is calculated separately
Value will calculate the ratio obtained as the similarity value of function pair.
6. a kind of Faas stage function creation method, which is characterized in that described method includes following steps:
S1, the first function information for needing the first function created on Fass platform is determined;
S2, the title and first function parameter that first function is determined according to first function information;
S3, by the title of the first function and first function parameter with it is each in the Function Array of pre-stored preset format
The title and function parameter of function are matched;
If having the corresponding second function title of second function and second function parameter with described first in S4, the Function Array
Function name and the first function parameter successful match, then obtain the source code of the second function;
S5, the source code based on the second function carry out adaptation, to generate the first function.
7. Faas stage function creation method as claimed in claim 6, which is characterized in that in the step S1, described
One function information includes calling type of service, the programming language of function and the function of function of function.
8. Faas stage function creation method as claimed in claim 6, which is characterized in that in the step S2, described
The title of one function includes the corresponding class name of the first function, wherein a class includes multiple functions or multiple class packets
Include the same function;
The first function parameter includes the parameter of first function input and the implementing result of first function.
9. Faas stage function creation method as claimed in claim 6, which is characterized in that before the step S3, also wrap
Include the generation step of the Function Array of pre-stored preset format, the life of the Function Array of the pre-stored preset format
At the step of include:
The function of the first predefined quantity is obtained from the Faas platform;
According to predetermined function similarity analysis rule, each function in the function of the described first predefined quantity is analyzed respectively
Between similarity;
If there is the similarity between function and the function of the second predefined quantity to be greater than preset similarity threshold, it is based on the letter
The title and function parameter of several functions generate the Function Array of the preset format, wrap in the Function Array of the preset format
Include function similar with the function.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has Faas stage function to create journey
Sequence, the Faas stage function creation program can be executed by least one processor, so that at least one described processor executes
The step of Faas stage function creation method as described in any one of claim 6-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811255121.5A CN109683856B (en) | 2018-10-26 | 2018-10-26 | Electronic device, faas platform function creation method and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811255121.5A CN109683856B (en) | 2018-10-26 | 2018-10-26 | Electronic device, faas platform function creation method and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109683856A true CN109683856A (en) | 2019-04-26 |
CN109683856B CN109683856B (en) | 2024-08-16 |
Family
ID=66185248
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811255121.5A Active CN109683856B (en) | 2018-10-26 | 2018-10-26 | Electronic device, faas platform function creation method and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109683856B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111309304A (en) * | 2020-02-11 | 2020-06-19 | 北京字节跳动网络技术有限公司 | Method, device, medium and electronic equipment for generating IDL file |
CN112134918A (en) * | 2020-08-04 | 2020-12-25 | 杭州未名信科科技有限公司 | Method for detecting and processing matching state of function and trigger in cloud service |
CN113296750A (en) * | 2021-05-12 | 2021-08-24 | 阿里巴巴新加坡控股有限公司 | Function creating method and system, and function calling method and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108241543A (en) * | 2016-12-30 | 2018-07-03 | 深圳壹账通智能科技有限公司 | Method, service server and the system that business operation breakpoint performs |
CN108415671A (en) * | 2018-03-29 | 2018-08-17 | 上交所技术有限责任公司 | A kind of data de-duplication method and system of Oriented Green cloud computing |
KR20180099192A (en) * | 2017-02-28 | 2018-09-05 | 슈어소프트테크주식회사 | Method and apparatus for measuring code coverage and computer readable recording medium having program the same |
-
2018
- 2018-10-26 CN CN201811255121.5A patent/CN109683856B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108241543A (en) * | 2016-12-30 | 2018-07-03 | 深圳壹账通智能科技有限公司 | Method, service server and the system that business operation breakpoint performs |
KR20180099192A (en) * | 2017-02-28 | 2018-09-05 | 슈어소프트테크주식회사 | Method and apparatus for measuring code coverage and computer readable recording medium having program the same |
CN108415671A (en) * | 2018-03-29 | 2018-08-17 | 上交所技术有限责任公司 | A kind of data de-duplication method and system of Oriented Green cloud computing |
Non-Patent Citations (1)
Title |
---|
张曙光 等: "云存储中加密数据的自适应重复删除方法", 计算机应用研究, vol. 35, no. 9, 28 August 2017 (2017-08-28), pages 2772 - 2776 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111309304A (en) * | 2020-02-11 | 2020-06-19 | 北京字节跳动网络技术有限公司 | Method, device, medium and electronic equipment for generating IDL file |
CN111309304B (en) * | 2020-02-11 | 2023-07-11 | 北京字节跳动网络技术有限公司 | Method, device, medium and electronic equipment for generating IDL file |
CN112134918A (en) * | 2020-08-04 | 2020-12-25 | 杭州未名信科科技有限公司 | Method for detecting and processing matching state of function and trigger in cloud service |
CN112134918B (en) * | 2020-08-04 | 2023-04-07 | 杭州未名信科科技有限公司 | Method for detecting and processing matching state of function and trigger in cloud service |
CN113296750A (en) * | 2021-05-12 | 2021-08-24 | 阿里巴巴新加坡控股有限公司 | Function creating method and system, and function calling method and system |
CN113296750B (en) * | 2021-05-12 | 2023-12-08 | 阿里巴巴新加坡控股有限公司 | Function creation method and system, function calling method and system |
Also Published As
Publication number | Publication date |
---|---|
CN109683856B (en) | 2024-08-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109558290B (en) | Server, interface automatic test method and storage medium | |
CN109359797A (en) | Electronic device, loan collection case division method and storage medium | |
CN111414407A (en) | Data query method and device of database, computer equipment and storage medium | |
CN109933760A (en) | List generation method, device, computer equipment and computer readable storage medium | |
CN108255701B (en) | Scene testing method and mobile terminal | |
CN110058999A (en) | Electronic device, application exception localization method and storage medium | |
CN111276123B (en) | Method and device for voice broadcasting message, computer equipment and storage medium | |
CN109683856A (en) | Electronic device, Faas stage function creation method and storage medium | |
CN108337127B (en) | Application performance monitoring method, system, terminal and computer readable storage medium | |
CN109684073A (en) | Electronic device, cloud service resource allocation methods and storage medium | |
CN110069177A (en) | Electronic device, application program guiding method of operating and storage medium | |
CN110287093A (en) | Mobile terminal, data-interface test method and storage medium | |
CN109284198A (en) | A kind of method and apparatus verifying data | |
CN106101169A (en) | A kind of terminal and data reporting method | |
CN109684195A (en) | Electronic device, script conversion method and storage medium | |
CN113296987A (en) | Interface calling method and device for calling module, computer equipment and storage medium | |
CN104834649A (en) | Intelligent equipment capable of realizing multi-equipment synergy and multi-equipment synergy working method | |
WO2021098393A1 (en) | Method and apparatus for intelligent system resource monitoring, electronic device, and storage medium | |
CN110191013A (en) | Electronic device, the Mock test method of more capital's interfaces and storage medium | |
CN110765610A (en) | PDM (product data management) integration method and device, computer equipment and storage medium | |
CN109634806A (en) | Electronic device, server cluster monitoring method and storage medium | |
CN115113898A (en) | Dynamic updating method and device for micro application, computer equipment and storage medium | |
CN114879988A (en) | Online upgrade method and device, computer equipment and storage medium | |
CN109634602A (en) | Electronic device, man-machine ballot recognition methods and storage medium | |
CN111523872A (en) | Transaction processing method and device, mobile terminal and computer readable storage medium |
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 |