CN113377376A - Data packet generation method, data packet generation device, electronic device, and storage medium - Google Patents

Data packet generation method, data packet generation device, electronic device, and storage medium Download PDF

Info

Publication number
CN113377376A
CN113377376A CN202110645282.0A CN202110645282A CN113377376A CN 113377376 A CN113377376 A CN 113377376A CN 202110645282 A CN202110645282 A CN 202110645282A CN 113377376 A CN113377376 A CN 113377376A
Authority
CN
China
Prior art keywords
data packet
code
service
public
source code
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.)
Pending
Application number
CN202110645282.0A
Other languages
Chinese (zh)
Inventor
赵海强
罗涛
王俊宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110645282.0A priority Critical patent/CN113377376A/en
Publication of CN113377376A publication Critical patent/CN113377376A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation

Abstract

The embodiment of the disclosure provides a data packet generation method, a data packet generation device, an electronic device and a storage medium, which can be applied to the technical field of computers and the technical field of finance. The data packet generation method comprises the following steps: analyzing the source code to obtain an analysis result; determining a common code in the source code according to the referenced common file information under the condition that the analysis result is determined to include information for referencing the common file; packaging the public codes to obtain a public data packet; determining a service code in the source code according to the referenced service file information under the condition that the analysis result is determined to include information for referencing the service file; and packaging the service codes to obtain a service data packet.

Description

Data packet generation method, data packet generation device, electronic device, and storage medium
Technical Field
The present disclosure relates to the field of computer technology and financial technology, and more particularly, to a data packet generation method, a data packet generation apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
The code written based on the cross-terminal development framework can be written once and run at multiple terminals. In the above process, a packet packing operation is involved.
In implementing the disclosed concept, the inventors found that there are at least the following problems in the related art: the volume of the data packet is larger, and further the network transmission flow is increased.
Disclosure of Invention
In view of this, the disclosed embodiments provide a data packet generation method, a data packet generation apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
One aspect of the embodiments of the present disclosure provides a data packet generation method, including:
analyzing the source code to obtain an analysis result;
under the condition that the analysis result is determined to include information for referring to a public file, determining a public code in the source code according to the referred public file information;
packaging the public codes to obtain a public data packet;
determining a service code in the source code according to the referred service file information under the condition that the analysis result is determined to include information for referring to the service file; and
and packaging the service codes to obtain a service data packet.
According to an embodiment of the present disclosure, the parsing the source code to obtain a parsing result includes:
determining a parser for parsing the source code according to input parameters of a dependent function included in the source code, wherein the parser includes a common parser and a service parser;
under the condition that the input parameters are determined to comprise public identifications, analyzing the source codes by using the public analyzer to obtain analysis results; and
and under the condition that the input parameters comprise service identifications, analyzing the source codes by using the service analyzer to obtain the analysis result.
According to an embodiment of the present disclosure, the packaging the public code to obtain a public data packet includes:
carrying out compression and confusion on the public codes to obtain first compression and confusion codes; and
and packaging the first compressed and confused code to obtain the public data packet.
According to an embodiment of the present disclosure, the packing the first compressed obfuscated code to obtain the public data packet includes:
generating a first file according to the first compressed obfuscated code; and
and packaging the first file to obtain the public data packet.
According to an embodiment of the present disclosure, the packaging the service code to obtain a service data packet includes:
compressing and obfuscating the service code to obtain a second compressed and obfuscated code; and
and packaging the second compressed and confused codes to obtain the service data packet.
According to an embodiment of the present disclosure, the packing the second compressed obfuscated code to obtain the service data packet includes:
generating a second file according to the second compressed and obfuscated code; and
and packaging the second file to obtain the service data packet.
According to an embodiment of the present disclosure, the data packet generation method further includes:
determining path information of the quoted picture according to the analysis result;
determining an initial effective picture according to the path information; and
and deleting other pictures except the initial effective picture from the data packet corresponding to the source code.
According to an embodiment of the present disclosure, the data packet generation method further includes:
determining the abstract value of the initial effective picture;
determining a target effective picture from the initial effective pictures according to the abstract value, wherein the abstract values of different target effective pictures are different; and
and deleting other initial effective pictures except the target effective picture from the data packet corresponding to the source code.
According to an embodiment of the present disclosure, the data packet generation method further includes:
determining a same group of effective pictures, wherein the same group of effective pictures comprises a plurality of target effective pictures, and different target effective pictures in the same group of effective pictures have the same path information and different abstract values; and
and deleting redundant target effective pictures in the same group of effective pictures from a data packet corresponding to the source code, so that the same group of effective pictures comprises one target effective picture.
According to an embodiment of the present disclosure, the source code is code developed based on a cross-end development framework.
Another aspect of the embodiments of the present disclosure provides a packet generation apparatus, including:
the analysis module is used for analyzing the source code to obtain an analysis result;
a first determining module, configured to determine, when it is determined that the parsing result includes information for referencing a common file, a common code in the source code according to the referenced common file information;
the first packing module is used for packing the public codes to obtain a public data packet;
a second determining module, configured to determine, according to the service file information that is used for referencing, a service code in the source code when it is determined that the parsing result includes information that is used for referencing the service file; and
and the second packing module is used for packing the service codes to obtain a service data packet.
Another aspect of an embodiment of the present disclosure provides an electronic device including: one or more processors; a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described above.
Another aspect of the embodiments of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when executed.
Another aspect of an embodiment of the present disclosure provides a computer program product comprising computer executable instructions for implementing the method as described above when executed.
According to the embodiment of the disclosure, a technical means that a public code in a source code is determined according to quoted public file information, the public code is packaged to obtain a public data packet, a service code in the source code is determined according to quoted service file information, the service code is packaged to obtain a service data packet, and the public data packet corresponding to the public code is separated from the service data packet corresponding to the service code, so that the volume of the service data packet is reduced, the technical problem that the volume of the data packet is large is at least partially overcome, the network transmission flow is increased, the volume of the service data packet is reduced, and the technical effect of the network transmission flow is reduced.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an exemplary system architecture for an application data packet generation method according to an embodiment of the present disclosure;
FIG. 2 schematically shows a flow chart of a method of data packet generation according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a method of data packet generation according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart of a method of data packet generation according to another embodiment of the present disclosure;
fig. 5 schematically shows a block diagram of a packet generation apparatus according to an embodiment of the present disclosure; and
fig. 6 schematically shows a block diagram of an electronic device adapted to implement a data packet generation method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
And in the process of making the data packet, the data packet is made by packaging through a native command of a cross-end development framework.
Because of the large number of repeated codes included in the data packet, the data packet is made to be large in size, and therefore, the network transmission flow required by the data packet in the transmission process is large.
In view of this, embodiments of the present disclosure provide a data packet generation method, a data packet generation apparatus, an electronic device, a computer-readable storage medium, and a computer program product. The method comprises the steps of analyzing a source code, determining a public code and a service code in the source code, and packaging the public code or the service code to obtain a public data packet or a service data packet.
It should be noted that the method and apparatus for generating a data packet provided by the present invention may be used in the financial field, for example, a bank, or may be used in any field other than the financial field, for example, a computer field.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which the packet generation method may be applied, according to an embodiment of the disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 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 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the data packet generation method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the packet generation apparatus provided by the embodiment of the present disclosure may be generally disposed in the server 105. The data packet generation method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the packet generation apparatus provided in the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically shows a flow chart of a data packet generation method according to an embodiment of the present disclosure.
As shown in fig. 2, the packet generation method may include operations S210 to S250.
In operation S210, the source code is parsed to obtain a parsing result.
In operation S220, in case that it is determined that the parsing result includes information for referring to the common file, a common code in the source code is determined according to the referred common file information.
In operation S230, the public code is packed to obtain a public data packet.
In operation S240, in case that it is determined that the parsing result includes information for referring to the service file, a service code in the source code is determined according to the referred service file information.
In operation S250, the service code is packaged to obtain a service data packet.
According to an embodiment of the disclosure, the source code may include code in a Bundle package written based on a cross-end development framework. The public file may include a base.js file, the public file information may include basic module information in the base.js file, and the basic module information may include, but is not limited to, core component information or IFOP general component library information, where the core component information may include component information such as fact or RN. The business document information may include, but is not limited to, business information for financing or insurance in the financial technology field.
According to the embodiment of the disclosure, the analysis result of the source code is judged, and the public code or the service code is respectively packaged to respectively obtain the public data packet or the service data packet under the condition that the analysis result comprises information for referring to the public file or information for referring to the service file.
According to the embodiment of the disclosure, a technical means that a public code in a source code is determined according to quoted public file information, the public code is packaged to obtain a public data packet, a service code in the source code is determined according to quoted service file information, the service code is packaged to obtain a service data packet, and the public data packet corresponding to the public code is separated from the service data packet corresponding to the service code, so that the volume of the service data packet is reduced, the technical problem that the volume of the data packet is large is at least partially overcome, the network transmission flow is increased, the volume of the service data packet is reduced, and the technical effect of the network transmission flow is reduced.
According to an embodiment of the present disclosure, parsing the source code to obtain a parsing result may include the following operations.
And determining a parser for parsing the source code according to input parameters of a dependent function included in the source code, wherein the parser comprises a common parser and a business parser. And in the case that the input parameters are determined to comprise the public identification, analyzing the source code by using a public analyzer to obtain an analysis result. And under the condition that the input parameters comprise the service identification, analyzing the source code by using a service analyzer to obtain an analysis result.
According to the embodiment of the disclosure, a public resolver and a business resolver are respectively established according to a dependent function, and a source code is resolved by the public resolver under the condition that the input parameters of the dependent function of the public resolver comprise a public identity, so that a resolution result is obtained.
According to the embodiment of the disclosure, under the condition that the input parameters of the dependency function of the service resolver comprise the service identifier, the service resolver is used for resolving the source code to obtain a resolving result.
According to an embodiment of the present disclosure, packing the public codes to obtain the public data packet may include the following operations.
And carrying out compression and obfuscation on the common codes to obtain first compression and obfuscation codes. And packaging the first compressed obfuscated code to obtain a public data packet.
According to embodiments of the present disclosure, the tools for compression obfuscation may include, but are not limited to, the js (javascript) Transformer tool.
According to the embodiment of the disclosure, a compression and obfuscation tool is used for performing compression and obfuscation on the public codes to obtain first compression and obfuscation codes, and the first compression and obfuscation codes are packaged to obtain a public data packet.
According to an embodiment of the present disclosure, packing the first compressed obfuscated code to obtain the common data packet may include the following operations.
A first file is generated based on the first compressed obfuscated code. And packaging the first file to obtain a public data packet.
According to an embodiment of the disclosure, the first file may include a file containing a first compressed obfuscated code, for example, the first file may be a first folder, and the first compressed obfuscated code is included in the first folder.
According to the embodiment of the disclosure, a first file is generated according to the obtained first compressed obfuscated code, and the first file is packaged to obtain a public data packet.
According to an embodiment of the present disclosure, packing the service code to obtain the service data packet may include the following operations.
And performing compression and confusion on the service codes to obtain second compression and confusion codes. And packaging the second compressed obfuscated code to obtain a service data packet.
According to embodiments of the present disclosure, the tools for compression obfuscation may include, but are not limited to, the js (javascript) Transfbrmer tool.
According to the embodiment of the disclosure, a compression and confusion tool is used for carrying out compression and confusion on the service codes to obtain second compression and confusion codes, and the second compression and confusion codes are packaged to obtain the service data packet.
According to an embodiment of the present disclosure, packing the second compressed obfuscated code to obtain the service data packet may include the following operations.
And generating a second file according to the second compressed obfuscated code. And packaging the second file to obtain a service data packet.
According to an embodiment of the disclosure, the second file may include a file containing a second compressed obfuscation code, for example, the second file may be folder two, and the folder two contains the second compressed obfuscation code therein.
According to the embodiment of the disclosure, a second file is generated according to the obtained second compressed obfuscated code, and the second file is packaged to obtain a service data packet.
According to the embodiment of the disclosure, the reason for the large volume of the data packet further includes that the data packet contains more repeated pictures.
Fig. 3 schematically shows a flow chart of a data packet generation method according to another embodiment of the present disclosure.
As shown in fig. 3, the above-mentioned packet generation method may further include operations S310 to S330.
In operation S310, path information of the referenced picture is determined according to the parsing result.
In operation S320, an initial valid picture is determined according to the path information.
In operation S330, pictures other than the initial valid picture are deleted from the packet corresponding to the source code.
According to the embodiment of the present disclosure, path information of a referenced picture is determined according to a parsing result. And determining an initial effective picture from a plurality of pictures in a data packet corresponding to the source code according to the path information. Deleting the other pictures except the initial effective picture in the plurality of pictures.
According to the embodiment of the disclosure, other pictures except the initial valid picture are deleted from the data packet corresponding to the source code, so that a technical means that the data packet corresponding to the source code does not include the invalid picture is realized, the technical problem that the volume of the data packet is large and further the network transmission flow is increased due to the fact that the data packet includes some repeated pictures is at least partially solved, and the technical effect that the volume of a service data packet is reduced and further the network transmission flow is reduced due to the fact that the data packet corresponding to the source code does not include the invalid picture is achieved.
According to an embodiment of the present disclosure, the above-mentioned data packet generation method may further include the following operations.
And determining the abstract value of the initial effective picture. And determining a target effective picture from the initial effective pictures according to the abstract value, wherein the abstract values of different target effective pictures are different. And deleting other initial effective pictures except the target effective picture from the data packet corresponding to the source code.
According to an embodiment of the present disclosure, the Digest value may be determined using an MD4(Message Digest 4) algorithm, an MD5(Message Digest 5) algorithm, or an sha (secure Hash algorithm) algorithm.
According to the embodiment of the disclosure, in the data packet corresponding to the source code, the target effective picture is determined according to the digest value of the initial effective picture, and other initial effective pictures which are not the target effective picture are deleted, that is, one of the target effective pictures is retained and the rest of the target effective pictures are deleted in the target effective pictures with the same digest value.
According to an embodiment of the present disclosure, the above-mentioned data packet generation method may further include the following operations.
Determining the same group of effective pictures, wherein the same group of effective pictures comprises a plurality of target effective pictures, and different target effective pictures included in the same group of effective pictures have the same path information and different digest values. And deleting redundant target effective pictures in the same group of effective pictures from the data packet corresponding to the source code, so that the same group of effective pictures comprises one target effective picture.
According to the embodiment of the disclosure, the resolution of different target effective pictures included in the same group of effective pictures is different, and other information is the same. According to the embodiment of the disclosure, the preset resolution can be set according to the service requirement, and the target effective picture different from the preset resolution is deleted, so that the target effective picture corresponding to the preset resolution is reserved for the same group of effective pictures. The redundant target effective pictures are deleted, so that the volume of the data packet can be reduced.
According to an embodiment of the present disclosure, the source code is code developed based on a cross-end development framework.
According to an embodiment of the present disclosure, the cross-end development framework may include, but is not limited to, a read Native development framework, a Flutter development framework, an Ionic development framework, an Apache Cordova development framework, a Xamarin development framework, a Native script development framework, or the like. The upper layer of the React Native (namely RN) adopts Javascript language to write codes, and the lower layer adopts android or IOS Native rendering mode, so that one-time code writing is realized, and the multi-terminal running can be realized. The rendering efficiency and performance experience of the page are guaranteed by adopting a native rendering mode for the bottom layer.
Fig. 4 schematically shows a flow chart of a data packet generation method according to another embodiment of the present disclosure.
As shown in fig. 4, the packet generation method may include the following operations.
In operation S401, a parser for parsing a source code is determined according to an input parameter of a dependent function included in the source code, where the parser includes a common parser and a service parser.
In operation S402, in the case that it is determined that the input parameter includes the service identifier, the source code is parsed by using the service parser, and a parsing result is obtained.
In operation S403, in case that it is determined that the parsing result includes information for referring to the service file, a service code in the source code is determined according to the referred service file information.
In operation S404, the service code is compressed and obfuscated to obtain a second compressed and obfuscated code.
In operation S405, a second file is generated according to the second compressed obfuscated code.
In operation S406, the second file is packaged to obtain the service data packet.
In operation S407, in case that it is determined that the input parameter includes the public identity, the source code is parsed using the public parser, resulting in a parsing result.
In operation S408, in case that it is determined that the parsing result includes information for referring to the common file, a common code in the source code is determined according to the referred common file information.
In operation S409, the common code is compressed and obfuscated to obtain a first compressed obfuscated code.
In operation S410, a first file is generated according to the first compressed obfuscated code.
In operation S411, the first file is packaged to obtain the public data packet.
According to the embodiment of the disclosure, a technical means that a public code in a source code is determined according to quoted public file information, the public code is packaged to obtain a public data packet, a service code in the source code is determined according to quoted service file information, the service code is packaged to obtain a service data packet, and the public data packet corresponding to the public code is separated from the service data packet corresponding to the service code, so that the volume of the service data packet is reduced, the technical problem that the volume of the data packet is large is at least partially overcome, the network transmission flow is increased, the volume of the service data packet is reduced, and the technical effect of the network transmission flow is reduced.
Fig. 5 schematically shows a block diagram of a packet generation apparatus according to an embodiment of the present disclosure.
As shown in fig. 5, the packet generating apparatus 500 includes a parsing module 510, a first determining module 520, a first packing module 530, a second determining module 540, and a second packing module 550.
The parsing module 510 is configured to parse the source code to obtain a parsing result;
a first determining module 520, configured to determine a common code in the source code according to the referenced common file information if it is determined that the parsing result includes information for referencing the common file;
a first packing module 530, configured to pack the public codes to obtain a public data packet;
a second determining module 540, configured to determine, according to the referred service file information, a service code in the source code if it is determined that the parsing result includes information for referring to the service file; and
and a second packing module 550, configured to pack the service code to obtain a service data packet.
According to the embodiment of the disclosure, a technical means that a public code in a source code is determined according to quoted public file information, the public code is packaged to obtain a public data packet, a service code in the source code is determined according to quoted service file information, the service code is packaged to obtain a service data packet, and the public data packet corresponding to the public code is separated from the service data packet corresponding to the service code, so that the volume of the service data packet is reduced, the technical problem that the volume of the data packet is large is at least partially overcome, the network transmission flow is increased, the volume of the service data packet is reduced, and the technical effect of the network transmission flow is reduced.
According to an embodiment of the present disclosure, the parsing module 510 may include a first determining unit, a first parsing unit, and a second parsing unit.
The system comprises a first determining unit and a second determining unit, wherein the first determining unit is used for determining a parser for parsing the source code according to input parameters of a dependent function included in the source code, and the parser comprises a common parser and a business parser.
And the first analysis unit is used for analyzing the source code by using a public analyzer under the condition that the input parameters comprise the public identification to obtain an analysis result.
And the second analysis unit is used for analyzing the source code by using the service analyzer under the condition that the input parameters comprise the service identification to obtain an analysis result.
According to an embodiment of the present disclosure, the first packing module 530 may include a first compression unit and a first packing unit.
And the first compression unit is used for carrying out compression and obfuscation on the public codes to obtain first compression and obfuscation codes.
And the first packing unit is used for packing the first compressed obfuscated code to obtain a public data packet.
According to an embodiment of the present disclosure, the first packing unit may include a first generating subunit and a first packing subunit.
And the first generation subunit is used for generating a first file according to the first compressed obfuscated code.
And the first packing subunit is used for packing the first file to obtain a public data packet.
According to an embodiment of the present disclosure, the second packing module 550 may include a second compression unit and a second packing unit.
And the second compression unit is used for compressing and obfuscating the service code to obtain a second compressed and obfuscated code.
And the second packing unit is used for packing the second compressed and confused code to obtain the service data packet.
According to an embodiment of the present disclosure, the second packing unit may include a second generating sub-unit and a second packing sub-unit.
And the second generation subunit is used for generating a second file according to the second compressed obfuscated code.
And the second packing subunit is used for packing the second file to obtain a service data packet.
According to an embodiment of the present disclosure, the above-mentioned data packet generating apparatus may further include a third determining module, a fourth determining module, and a first deleting module.
And the third determining module is used for determining the path information of the quoted picture according to the analysis result.
And the fourth determining module is used for determining the initial effective picture according to the path information.
And the first deleting module is used for deleting other pictures except the initial effective picture from the data packet corresponding to the source code.
According to an embodiment of the present disclosure, the packet generation apparatus may further include a fifth determination module, a sixth determination module, and a second deletion module.
And the fifth determining module is used for determining the abstract value of the initial effective picture.
And the sixth determining module is used for determining the target effective pictures from the initial effective pictures according to the abstract values, wherein the abstract values of different target effective pictures are different.
And the second deleting module is used for deleting other initial effective pictures except the target effective picture from the data packet corresponding to the source code.
According to an embodiment of the present disclosure, the packet generation apparatus may further include a seventh determination module and a third deletion module.
And the seventh determining module is used for determining the same group of effective pictures, wherein the same group of effective pictures comprises a plurality of target effective pictures, and different target effective pictures in the same group of effective pictures have the same path information and different digest values.
And the third deleting module is used for deleting redundant target effective pictures in the same group of effective pictures from the data packet corresponding to the source code, so that the same group of effective pictures comprises one target effective picture.
According to the embodiment of the disclosure, other pictures except the initial valid picture are deleted from the data packet corresponding to the source code, so that a technical means that the data packet corresponding to the source code does not include the invalid picture is realized, the technical problem that the volume of the data packet is large and further the network transmission flow is increased due to the fact that the data packet includes some repeated pictures is at least partially solved, and the technical effect that the volume of a service data packet is reduced and further the network transmission flow is reduced due to the fact that the data packet corresponding to the source code does not include the invalid picture is achieved.
Any of the modules, units, sub-units, or at least part of the functionality of any of them according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, units and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, units, and sub-units according to the embodiments of the present disclosure may be implemented at least partially as a hardware Circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a Circuit, or implemented by any one of or a suitable combination of software, hardware, and firmware. Alternatively, one or more of the modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as computer program modules, which, when executed, may perform the corresponding functions.
For example, any plurality of the parsing module 510, the first determining module 520, the first packing module 530, the second determining module 540, and the second packing module 550 may be combined and implemented in one module/unit/sub-unit, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the parsing module 510, the first determining module 520, the first packing module 530, the second determining module 540, and the second packing module 550 may be at least partially implemented as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the parsing module 510, the first determining module 520, the first packing module 530, the second determining module 540, and the second packing module 550 may be at least partially implemented as a computer program module that, when executed, may perform a corresponding function.
It should be noted that the data packet generation device portion in the embodiment of the present disclosure corresponds to the data packet generation method portion in the embodiment of the present disclosure, and the description of the data packet generation device portion specifically refers to the data packet generation method portion, which is not described herein again.
Fig. 6 schematically shows a block diagram of an electronic device adapted to implement the above described method according to an embodiment of the present disclosure. The electronic 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 disclosure.
As shown in fig. 6, an electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which 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. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 600 may also include input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604, according to an embodiment of the disclosure. The electronic device 600 may also include one or more of the following components 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 Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; 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.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure 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 storage medium, the computer program containing program code for performing the method illustrated by 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, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. In accordance with embodiments of the present disclosure, the systems, devices, apparatuses, modules, units, sub-units, etc. described above may be implemented by computer program modules.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: 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), a portable compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the preceding. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 602 and/or RAM 603 described above and/or one or more memories other than the ROM 602 and RAM 603.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method provided by the embodiments of the present disclosure, when the computer program product is run on an electronic device, the program code being configured to cause the electronic device to implement the method for generating a data package provided by the embodiments of the present disclosure.
The computer program, when executed by the processor 601, performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, downloaded and installed through the communication section 609, and/or installed from the removable medium 611. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the account computing device, partly on the account device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the account computing device through any kind of Network, including a Local Area Network (LAN) or Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
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 disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams 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. Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (14)

1. A method of packet generation, comprising:
analyzing the source code to obtain an analysis result;
determining a common code in the source code according to the referenced common file information under the condition that the analysis result is determined to include information for referencing a common file;
packaging the public codes to obtain a public data packet;
determining a service code in the source code according to the referred service file information under the condition that the analysis result is determined to include information for referring to the service file; and
and packaging the service codes to obtain a service data packet.
2. The method of claim 1, wherein the parsing the source code to obtain a parsing result comprises:
determining a parser for parsing the source code according to input parameters of a dependent function included in the source code, wherein the parser comprises a common parser and a service parser;
under the condition that the input parameters comprise public identifications, analyzing the source codes by using the public analyzer to obtain analysis results; and
and under the condition that the input parameters comprise the service identification, analyzing the source code by using the service analyzer to obtain an analysis result.
3. The method of claim 1, wherein said packaging the common code to obtain a common data packet comprises:
carrying out compression and confusion on the public codes to obtain first compression and confusion codes; and
and packaging the first compressed obfuscated code to obtain the public data packet.
4. The method of claim 3, wherein the packing the first compressed obfuscated code to obtain the common data packet comprises:
generating a first file according to the first compressed obfuscated code; and
and packaging the first file to obtain the public data packet.
5. The method according to any one of claims 1 to 4, wherein the packaging the service code to obtain a service data packet comprises:
compressing and obfuscating the service code to obtain a second compressed and obfuscated code; and
and packaging the second compressed obfuscated code to obtain the service data packet.
6. The method of claim 5, wherein the packaging the second compressed obfuscated code to obtain the service data packet comprises:
generating a second file according to the second compressed obfuscated code; and
and packaging the second file to obtain the service data packet.
7. The method of claim 1, further comprising:
determining path information of the quoted picture according to the analysis result;
determining an initial effective picture according to the path information; and
and deleting other pictures except the initial effective picture from the data packet corresponding to the source code.
8. The method of claim 7, further comprising:
determining a digest value of the initial effective picture;
determining a target effective picture from the initial effective pictures according to the abstract value, wherein the abstract values of different target effective pictures are different; and
and deleting other initial effective pictures except the target effective picture from the data packet corresponding to the source code.
9. The method of claim 8, further comprising:
determining a same group of effective pictures, wherein the same group of effective pictures comprises a plurality of target effective pictures, and different target effective pictures in the same group of effective pictures have the same path information and different digest values; and
and deleting redundant target effective pictures in the same group of effective pictures from a data packet corresponding to the source code, so that the same group of effective pictures comprises one target effective picture.
10. The method of any of claims 1-4, wherein the source code is code developed based on a cross-end development framework.
11. A packet generation apparatus comprising:
the analysis module is used for analyzing the source code to obtain an analysis result;
the first determination module is used for determining a public code in the source code according to the referenced public file information under the condition that the analysis result is determined to comprise information for referencing a public file;
the first packing module is used for packing the public codes to obtain a public data packet;
the second determining module is used for determining the service code in the source code according to the quoted service file information under the condition that the analysis result is determined to comprise the service file information quoted; and
and the second packing module is used for packing the service codes to obtain a service data packet.
12. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-10.
13. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 10.
14. A computer program product comprising a computer program which, when executed by a processor, is adapted to carry out the method of any one of claims 1 to 10.
CN202110645282.0A 2021-06-09 2021-06-09 Data packet generation method, data packet generation device, electronic device, and storage medium Pending CN113377376A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110645282.0A CN113377376A (en) 2021-06-09 2021-06-09 Data packet generation method, data packet generation device, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110645282.0A CN113377376A (en) 2021-06-09 2021-06-09 Data packet generation method, data packet generation device, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
CN113377376A true CN113377376A (en) 2021-09-10

Family

ID=77573438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110645282.0A Pending CN113377376A (en) 2021-06-09 2021-06-09 Data packet generation method, data packet generation device, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN113377376A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116382703A (en) * 2023-06-07 2023-07-04 建信金融科技有限责任公司 Software package generation method, code development method and device, electronic equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116382703A (en) * 2023-06-07 2023-07-04 建信金融科技有限责任公司 Software package generation method, code development method and device, electronic equipment and medium
CN116382703B (en) * 2023-06-07 2023-08-22 建信金融科技有限责任公司 Software package generation method, code development method and device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN109873735B (en) Performance test method and device for H5 page and computer equipment
CN107404418B (en) Internet product testing method, device, equipment and storage medium
CN107479868B (en) Interface loading method, device and equipment
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN110795649A (en) Target page display method, device and system and electronic equipment
CN110928571A (en) Business program development method and device
CN112395098B (en) Application program interface calling method and device, storage medium and electronic equipment
CN114237651A (en) Installation method and device of cloud native application, electronic equipment and medium
CN113377376A (en) Data packet generation method, data packet generation device, electronic device, and storage medium
CN113760283A (en) Text rendering method and device
CN115982491A (en) Page updating method and device, electronic equipment and computer readable storage medium
CN113535565B (en) Interface use case generation method, device, equipment and medium
CN113157274B (en) Software development method and device based on micro front end, electronic equipment and storage medium
CN115576536A (en) Method and system for automatically generating interface document by analyzing byte codes
CN113132400B (en) Business processing method, device, computer system and storage medium
CN113553123A (en) Data processing method and device, electronic equipment and storage medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN114115871A (en) Page data embedding method and device, storage medium and electronic equipment
CN113127783A (en) Page display method and device, equipment and medium
CN112068814A (en) Method, device, system and medium for generating executable file
CN111752559A (en) Front-end and back-end separation system, method, device and storage medium
CN111008178B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN112596838B (en) Method, device, equipment and storage medium for displaying universal Web page

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