CN113268267B - Data packet generation method and device, computer equipment and storage medium - Google Patents

Data packet generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113268267B
CN113268267B CN202110559975.8A CN202110559975A CN113268267B CN 113268267 B CN113268267 B CN 113268267B CN 202110559975 A CN202110559975 A CN 202110559975A CN 113268267 B CN113268267 B CN 113268267B
Authority
CN
China
Prior art keywords
data packet
type
generation
file
content file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110559975.8A
Other languages
Chinese (zh)
Other versions
CN113268267A (en
Inventor
周煦杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202110559975.8A priority Critical patent/CN113268267B/en
Publication of CN113268267A publication Critical patent/CN113268267A/en
Application granted granted Critical
Publication of CN113268267B publication Critical patent/CN113268267B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the application discloses a data packet generation method, a data packet generation device, computer equipment and a storage medium, wherein the data packet generation parameter can be acquired; determining a data packet generation type according to the data packet generation parameters; acquiring an update content file corresponding to the data packet generation type and the type of the update content file; generating a configuration file according to the type of the updated content file; and generating a data packet according to the configuration file. The method and the device realize automatic generation of the configuration file to generate the data packet, and improve the accuracy and efficiency of data packet generation.

Description

Data packet generation method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer software development, and in particular, to a method and apparatus for generating a data packet, a computer device, and a storage medium.
Background
Android (Android) system components are modularized, the system components are generally required to be packaged into an apex package, and at present, the apex packaging process is approximately as follows: compiling the configuration file is manually written by a developer, and the configuration in some fixed files in the source code is manually modified, and then compiling is performed. Because the existing packing mode relies on manual configuration, the packing mode is easy to make mistakes and has low efficiency.
Disclosure of Invention
The embodiment of the application provides a data packet generation method, a data packet generation device, computer equipment and a storage medium, which can improve the accuracy and efficiency of data packet generation.
In order to solve the technical problems, the embodiment of the application provides the following technical scheme:
In a first aspect of the present application, a method for generating a data packet is provided, including:
Acquiring data packet generation parameters;
determining a data packet generation type according to the data packet generation parameters;
acquiring an update content file corresponding to the data packet generation type and the type of the update content file;
Generating a configuration file according to the type of the updated content file;
And generating a data packet according to the configuration file.
In one embodiment, the acquiring the data packet generation parameter includes:
receiving a data packet generation request;
And calling a data packet generation parameter based on the data packet generation request.
In an embodiment, the calling the packet generation parameter based on the packet generation request includes:
Triggering an operation script file based on the data packet generation request;
And calling a data packet generation parameter based on the script text.
In an embodiment, the determining the packet generation type according to the packet generation parameter includes:
If the data packet generation parameter is a global generation parameter, determining that the data packet generation type is a global generation type;
And if the data packet generation parameter is a local generation parameter, determining that the data packet generation type is a local generation type.
In an embodiment, the update content file includes a first update content file and a second update content file, and the generating a configuration file according to the update content file and the type of the update content file includes:
if the data packet generation type is a global generation type, generating a configuration file according to the first updated content file and the type of the first updated content file;
And if the data packet generation type is a local generation type, acquiring a history configuration file, and generating a configuration file according to the history configuration file, the second updated content file and the type thereof.
In one embodiment, generating a data packet according to the configuration file includes:
And compiling the configuration file to generate a data packet.
In one embodiment, after generating the data packet according to the configuration file, the method further includes:
Setting a version number for the data packet, and storing the data packet based on the version number.
In an embodiment, the obtaining the update content file corresponding to the packet generation type and the type of the update content file include:
Acquiring a file path corresponding to the data packet generation type;
Acquiring an updated content file from a storage location indicated by the file path;
and determining the type of the updated content file according to the suffix name of the updated content file.
The second aspect of the present application also provides a data packet generating device, including:
the first acquisition module is used for acquiring the data packet generation parameters;
The determining module is used for determining the generation type of the data packet according to the data packet generation parameters;
the second acquisition module is used for acquiring the updated content file corresponding to the data packet generation type and the type of the updated content file;
The first generation module is used for generating a configuration file according to the update content file and the type of the update content file;
and the second generation module is used for generating a data packet according to the configuration file.
In an embodiment, the first obtaining module is specifically configured to: receiving a data packet generation request; and calling a data packet generation parameter based on the data packet generation request.
In an embodiment, the first obtaining module is specifically configured to: triggering an operation script file based on the data packet generation request; and calling a data packet generation parameter based on the script text.
In one embodiment, the determining module is specifically configured to: if the data packet generation parameter is a global generation parameter, determining that the data packet generation type is a global generation type;
And if the data packet generation parameter is a local generation parameter, determining that the data packet generation type is a local generation type.
In an embodiment, the update content file includes a first update content file and a second update content file, and the first generation module is specifically configured to:
if the data packet generation type is a global generation type, generating a configuration file according to the first updated content file and the type of the first updated content file;
And if the data packet generation type is a local generation type, acquiring a history configuration file, and generating a configuration file according to the history configuration file, the second updated content file and the type thereof.
In an embodiment, the second generating module is specifically configured to: and compiling the configuration file to generate a data packet.
In an embodiment, the second generating module is further configured to set a version number for the data packet after generating the data packet according to the configuration file, and store the data packet based on the version number.
In an embodiment, the second obtaining module is specifically configured to: acquiring a file path corresponding to the data packet generation type; acquiring an updated content file from a storage location indicated by the file path; and determining the type of the updated content file according to the suffix name of the updated content file.
According to a third aspect of the present application, there is also provided a computer device, including a processor and a memory, where the memory stores a computer program, and when the processor invokes the computer program in the memory, any one of the data packet generating methods provided by the embodiments of the present application is executed.
According to a fourth aspect of the present application, there is also provided a storage medium for storing a computer program, the computer program being loaded by a processor to perform any one of the data packet generation methods provided by the embodiments of the present application.
The embodiment of the application can acquire the data packet generation parameters and determine the data packet generation type according to the data packet generation parameters; then the updated content file corresponding to the data packet generation type and the type of the updated content file can be obtained; at this time, a profile may be generated according to the update content file and the type of the update content file, and a data packet may be generated according to the profile. The scheme realizes automatic generation of the configuration file to generate the data packet, and improves the accuracy and efficiency of data packet generation.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a data packet generating method according to an embodiment of the present application;
fig. 2 is another flow chart of a data packet generating method according to an embodiment of the present application;
Fig. 3 is a schematic diagram of a packet generation device according to an embodiment of the present application;
Fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
The embodiment of the application provides a data packet generation method, a data packet generation device, computer equipment and a storage medium.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
In the present embodiment, description will be made from the viewpoint of a packet generation apparatus which may be integrated in a computer device such as a server. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, a content delivery network (Content Delivery Network, CDN), basic cloud computing services such as big data and an artificial intelligent platform, but is not limited thereto. The server and the terminal may be directly or indirectly connected through wired or time-wireless communication, which is not limited herein. The terminal can be a mobile phone, a computer, a household appliance or a wearable device, etc.
Referring to fig. 1, fig. 1 is a flowchart illustrating a packet generation method according to an embodiment of the application. The data packet generation method may include:
s101, acquiring data packet generation parameters.
The data packet generating parameters may be flexibly set according to actual needs, for example, when apex (Android Pony EXpress) data packets need to be generated, the data packet generating parameters may include parameters required by apex data packets. When apk (Android application package) packets need to be generated, the packet generation parameters may include parameters required for apk packets.
The apex data packet may be obtained by packaging Android system components, and the Android system components may include Activity (Activity), service (Service), broadcast receiver (Broadcast Receiver), content Provider (Content Provider), and the like. activity may be an application component that may provide a visualization area in which various controls may be placed, one application typically being composed of several activities so that a user may interact to accomplish a task. Service may be an application component, such as a music player, that performs operations in the background for a long period of time without providing a user interface. Broadcast Receiver may be a component for responding to a system-wide broadcast notification.
In an embodiment, acquiring the packet generation parameter may include: receiving a data packet generation request; based on the packet generation request, the packet generation parameters are invoked.
For example, the server may receive a packet generation request sent by the terminal, or receive a packet generation request sent by another server, where the packet generation request may include a parameter calling instruction and information required for generating a packet, and the server may call a packet generation parameter stored in advance in the database based on the packet generation request, or the server may call a packet generation parameter based on an address carried in the packet generation request, or the server may call a packet generation parameter based on a function identifier carried in the packet generation request, and so on. The data packet generation parameters are acquired through triggering of the data packet generation request, so that the reliability of acquiring the data packet generation parameters is improved.
In an embodiment, invoking the packet generation parameter based on the packet generation request may include: triggering an operation script file based on the data packet generation request; the packet generation parameters are invoked based on the script text.
The specific type, content, etc. of the script file may be flexibly set according to actual needs, which is not limited herein. For example, the server can trigger to run a script file corresponding to the apex data packet based on the data packet generation request, and then can call the data packet generation parameters based on the script text, so that the convenience of calling the data packet generation parameters is improved.
S102, determining the generation type of the data packet according to the generation parameters of the data packet.
For example, the content, type, or number of the packet generation parameters may be determined, and the packet generation type may be determined based on the content, type, or number of the packet generation parameters.
In an embodiment, determining the packet generation type according to the packet generation parameter may include: if the data packet generation parameter is the global generation parameter, determining that the data packet generation type is the global generation type; if the data packet generation parameter is a local generation parameter, determining that the data packet generation type is a local generation type.
The global generation parameters may be all parameters required for generating the data packet, and the global generation type may be brand new packing, i.e. the new data packet is regenerated regardless of the original data packet.
The local generation parameters may be part of parameters required for generating the data packet, and the local generation types may be newly added type packaging, i.e. modifying based on the original data packet to obtain a new data packet.
Specifically, after the data packet generation parameter is obtained, the type of the data packet generation parameter can be judged, and if the data packet generation parameter is the global generation parameter, the data packet generation type is determined to be the global generation type (namely, a brand new generation type); if the data packet generation parameter is a local generation parameter, the data packet generation type is determined to be a local generation type (namely, a newly added generation type), so that the data packet generation type can be rapidly judged.
S103, acquiring an update content file corresponding to the data packet generation type and the type of the update content file.
The specific content of the updated content file can be flexibly set according to actual needs, and the types of the updated content file can comprise types of ". So", ". Jar", ". Cpp", ". Java and the like.
In an embodiment, acquiring the update content file corresponding to the packet generation type, and the type of the update content file may include: acquiring a file path corresponding to the generation type of the data packet; acquiring an updated content file from a storage location indicated by the file path; and determining the type of the updated content file according to the suffix name of the updated content file.
Specifically, different types of update content files may be stored in different storage locations, respectively, and when the update content files need to be acquired, the update content files may be acquired based on a file path corresponding to the packet generation type. For example, the data packet generation type may be a global generation type, the corresponding update content file may be stored to a/source directory, i.e., the file path is/source, and the data packet generation type may be a local generation type, the corresponding update content file may be stored to a/add directory, i.e., the file path is/add. Then, when the determined data packet generation type is the global generation type, a first updated content file may be acquired from a storage location indicated by the file path/source, and the first updated content file may be a content file required for generating a configuration file corresponding to the global generation type. When the determined data packet generation type is the local generation type, a second updated content file may be obtained from a storage location indicated by the file path/add, and the second updated content file may be a content file required for generating a configuration file corresponding to the local generation type.
The updated content files may include content files such as ". So", ". Jar", ". Cpp", ". Java", ". At this time, the type of the update content file may be determined according to the suffix name of the update content file. The embodiment can accurately and quickly acquire the updated content file based on the file path, and accurately determine the type of the updated content file according to the suffix name of the updated content file.
It should be noted that, different types of updated content files may be stored in the same file path, and at this time, the required updated content file may be accurately obtained from the storage location indicated by the file path according to unique identification information such as the identification or index of the different types of updated content files.
S104, generating a configuration file according to the type of the updated content file.
After the updated content file and the type of the updated content file are obtained, a configuration file can be generated according to the updated content file and the type thereof by running a script file, the configuration file can be an android.bp file or an android.mk file, and the specific content and the type of the configuration file can be flexibly set according to actual needs. For example, the android file can be automatically generated through a script file by utilizing the high structuring of the android file, and compiling is performed, so that automatic packaging is realized.
The configuration file android.bp may include different types of modules, such as "cc_library", "cc_binary", and "apex" used by the definition apex module.
The definition of an attribute in the form of a key value within a module may be as follows:
Where cc_binary may represent compiled executable files, name: "name1" may represent compiled executable files named name1, srcs: [ "main.cpp" ] may represent source files named main.cpp.
In an embodiment, the update content file includes a first update content file and a second update content file, and generating the configuration file according to the update content file and the type of the update content file may include: if the data packet generation type is the global generation type, generating a configuration file according to the first updated content file and the type of the first updated content file; if the data packet generation type is the local generation type, acquiring a history configuration file, and generating the configuration file according to the history configuration file, the second updated content file and the type thereof.
For example, if the packet generation type is a global generation type, it is described that the configuration file needs to be generated according to a completely new generation mode, that is, the configuration file is regenerated according to the first updated content file and the type of the first updated content file, and the completely new configuration file is directly generated regardless of the history configuration file. If the data packet generation type is a local generation type, it is indicated that the configuration file needs to be generated according to a newly-added generation mode, for example, a history configuration file may be obtained, where the history configuration file may be a configuration file corresponding to an existing version of the data packet, and then the second update content file may be newly added to the history configuration file according to the type of the second update content file to generate the configuration file, that is, the history configuration file is modified based on the second update content file to obtain the configuration file.
S105, generating a data packet according to the configuration file.
The type of the data packet may be flexibly set according to actual needs, for example, the generated data packet may be an apex data packet or an apk data packet, where the apex data packet may include files such as apex_manifest.json, android management.xml, apex_payload.img, apex_ pubkey, and the apex_manifest.json may include a packet name PackageName, version number Version, and the like.
In an embodiment, generating the data packet according to the configuration file may include: compiling the configuration file to generate a data packet; and setting a version number for the data packet, and storing the data packet based on the version number.
For example, compiling may be performed on the configuration file to generate a data packet, and a version number may be set for the data packet, where the version number may be composed of a number or other characters, and the version number may be used to distinguish a new data packet from a historical data packet, for example, a version number corresponding to the data packet may be obtained by adding one to the version number of the historical data packet, or a corresponding version number may be set for the data packet according to a preset version number encoding policy, where the data packet may be stored based on the version number, and then the data packet may be searched based on the version number. According to the embodiment of the application, a developer does not need to manually edit the configuration file, android.bp of the configuration file can be automatically generated, input errors in the manual writing process are reduced, rapid and automatic generation of the apex data packet can be realized, and the development efficiency of each system component developer is improved.
The embodiment of the application can acquire the data packet generation parameters and determine the data packet generation type according to the data packet generation parameters; then the updated content file corresponding to the data packet generation type and the type of the updated content file can be obtained; at this time, a profile may be generated according to the update content file and the type of the update content file, and a data packet may be generated according to the profile. The scheme realizes automatic generation of the configuration file to generate the data packet, and improves the accuracy and efficiency of data packet generation.
The method described in the above embodiments is described in further detail below by way of example.
In this embodiment, as an example, a data packet generating device is integrated in a server, please refer to fig. 2, fig. 2 is a flow chart of a data packet generating method according to an embodiment of the present application. The method flow may include:
s201, the server receives a data packet generation request.
S202, the server triggers an operation script file based on the data packet generation request, and invokes data packet generation parameters based on the script text.
S203, the server determines the generation type of the data packet according to the generation parameters of the data packet.
If the data packet generation parameter is the global generation parameter, executing step S204; if the packet generation parameter is a local generation parameter, step S208 is performed.
S204, if the data packet generation parameter is the global generation parameter, the server determines that the data packet generation type is the global generation type.
S205, the server obtains the first updated content file from the first file path based on the global generation type, and determines the type of the first updated content file.
For example, the first file path may be a/source directory.
S206, the server generates a first configuration file according to the first updated content file and the type of the first updated content file.
S207, the server compiles the first configuration file to generate a first data packet, sets a version number for the first data packet, and stores the first data packet based on the version number.
S208, if the data packet generation parameter is a local generation parameter, the server determines that the data packet generation type is a local generation type.
S209, the server acquires the second updated content file from the second file path based on the local generation type, and determines the type of the second updated content file.
For example, the second file path may be an/add directory.
S210, the server acquires the history configuration file, and generates a second configuration file according to the history configuration file, the second updated content file and the type thereof.
S211, the server compiles the second configuration file to generate a second data packet, sets a version number for the second data packet, and stores the second data packet based on the version number.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of an embodiment that are not described in detail may be referred to the above detailed description of the method for generating a data packet, which is not repeated herein.
In the embodiment of the application, in the process of generating the apex data packet, the data packet generating parameters can be called by triggering the script file for running the data packet generation, and the data packet generating type is determined according to the data packet generating parameters, for example, the brand new type: generating a brand new configuration file regardless of the history configuration file; for another example, the newly added type: and adding content based on the history configuration file to obtain a new configuration file. Then, a file path corresponding to the packet generation type, for example, a brand new type correspondence/source path, an added type correspondence/add path is acquired, and an update content file is acquired from a storage location indicated by the file path. And determining the file type of the updated content file, for example, determining the file type of the updated content file according to the file suffix classification of ". So", ". Jar", and ". Cpp", ". Java", etc. At this time, an android.bp configuration file can be generated by running a script file based on the update content file and the type thereof, and compiling operation is performed according to the configuration file to generate an update data packet. The android. Bp configuration file is automatically generated, compiling is executed, automatic generation of the data packet is realized, and the data packet generation efficiency is improved.
In order to facilitate better implementation of the data packet generating method provided by the embodiment of the application, the embodiment of the application also provides a device based on the data packet generating method. The meaning of the nouns is the same as that in the data packet generation method, and specific implementation details can be referred to in the description of the method embodiment.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a packet generating device according to an embodiment of the present application, where the packet generating device may include a first obtaining module 301, a determining module 302, a second obtaining module 303, a first generating module 304, a second generating module 305, and so on.
The first obtaining module 301 is configured to obtain a packet generation parameter.
A determining module 302, configured to determine a packet generation type according to the packet generation parameter.
The second obtaining module 303 is configured to obtain an update content file corresponding to the packet generation type, and a type of the update content file.
The first generating module 304 is configured to generate a configuration file according to the update content file and the type of the update content file.
A second generating module 305, configured to generate a data packet according to the configuration file.
In an embodiment, the first obtaining module 301 is specifically configured to: receiving a data packet generation request; based on the packet generation request, the packet generation parameters are invoked.
In an embodiment, the first obtaining module 301 is specifically configured to: triggering an operation script file based on the data packet generation request; the packet generation parameters are invoked based on the script text.
In one embodiment, the determining module 302 is specifically configured to: if the data packet generation parameter is the global generation parameter, determining that the data packet generation type is the global generation type;
if the data packet generation parameter is a local generation parameter, determining that the data packet generation type is a local generation type.
In an embodiment, the updated content file includes a first updated content file and a second updated content file, and the first generating module 304 is specifically configured to:
If the data packet generation type is the global generation type, generating a configuration file according to the first updated content file and the type of the first updated content file;
if the data packet generation type is the local generation type, acquiring a history configuration file, and generating the configuration file according to the history configuration file, the second updated content file and the type thereof.
In one embodiment, the second generating module 305 is specifically configured to: compiling is performed on the configuration file to generate the data packet.
In an embodiment, the second generating module 305 is specifically further configured to: after generating the data packet according to the configuration file, setting a version number for the data packet, and storing the data packet based on the version number.
In an embodiment, the second obtaining module 303 is specifically configured to: acquiring a file path corresponding to the generation type of the data packet; acquiring an updated content file from a storage location indicated by the file path; and determining the type of the updated content file according to the suffix name of the updated content file.
In the embodiment of the application, the first acquisition module 301 acquires the data packet generation parameters, and the determination module 302 determines the data packet generation type according to the data packet generation parameters; the second obtaining module 303 may then obtain the update content file corresponding to the packet generation type, and the type of the update content file; at this time, a profile may be generated by the first generation module 304 according to the update content file and the type of the update content file, and a data packet may be generated by the second generation module 305 according to the profile. The scheme realizes automatic generation of the configuration file to generate the data packet, and improves the accuracy and efficiency of data packet generation.
The embodiment of the application also provides a computer device, which can be a server, as shown in fig. 4, and shows a schematic structural diagram of the computer device according to the embodiment of the application, specifically:
The computer device may include one or more processors 401 of a processing core, memory 402 of one or more computer readable storage media, a power supply 403, and an input unit 404, among other components. Those skilled in the art will appreciate that the computer device structure shown in FIG. 4 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components. Wherein:
the processor 401 is a control center of the computer device, connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 402, and calling data stored in the memory 402, thereby performing overall monitoring of the computer device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, etc., and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
The computer device further comprises a power supply 403 for supplying power to the various components, preferably the power supply 403 may be logically connected to the processor 401 by a power management system, so that functions of charge, discharge, and power consumption management may be performed by the power management system. The power supply 403 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The computer device may also include an input unit 404, which input unit 404 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 401 in the computer device loads executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 executes the application programs stored in the memory 402, so as to implement various functions as follows:
acquiring data packet generation parameters, and determining the data packet generation type according to the data packet generation parameters; acquiring an update content file corresponding to the generation type of the data packet and the type of the update content file; generating a configuration file according to the update content file and the type of the update content file, and generating a data packet according to the configuration file.
In one embodiment, the processor 401 may execute, when acquiring the packet generation parameter: receiving a data packet generation request; based on the packet generation request, the packet generation parameters are invoked.
In one embodiment, the processor 401 may execute, when invoking the packet generation parameter based on the packet generation request: triggering an operation script file based on the data packet generation request; the packet generation parameters are invoked based on the script text.
In one embodiment, in determining the packet generation type based on the packet generation parameters, the processor 401 may execute: if the data packet generation parameter is the global generation parameter, determining that the data packet generation type is the global generation type; or if the data packet generation parameter is a local generation parameter, determining that the data packet generation type is a local generation type.
In an embodiment, the update content file includes a first update content file and a second update content file, and the processor 401 may execute, when generating the configuration file according to the update content file and the type of the update content file: if the data packet generation type is the global generation type, generating a configuration file according to the first updated content file and the type of the first updated content file; or if the data packet generation type is the local generation type, acquiring the history configuration file, and generating the configuration file according to the history configuration file, the second updated content file and the type thereof.
In one embodiment, in generating a data packet from a configuration file, the processor 401 may execute: compiling the configuration file to generate a data packet; and setting a version number for the data packet, and storing the data packet based on the version number.
In an embodiment, when acquiring the update content file corresponding to the packet generation type and the type of the update content file, the processor 401 may execute: acquiring a file path corresponding to the generation type of the data packet; acquiring an updated content file from a storage location indicated by the file path; and determining the type of the updated content file according to the suffix name of the updated content file.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of an embodiment that are not described in detail may be referred to the above detailed description of the method for generating a data packet, which is not repeated herein.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the methods provided in the various alternative implementations of the above embodiments.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by computer instructions, or by controlling associated hardware, that may be stored in a storage medium and loaded and executed by a processor, where the storage medium is a computer-readable storage medium. To this end, an embodiment of the present application provides a storage medium in which a computer program is stored, where the computer program may include computer instructions that can be loaded by a processor to perform any of the data packet generation methods provided in the embodiments of the present application.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Because the computer instructions stored in the storage medium can execute any data packet generating method provided by the embodiment of the present application, the beneficial effects that any data packet generating method provided by the embodiment of the present application can achieve can be achieved, and detailed descriptions are omitted herein.
The foregoing has described in detail the method, apparatus, computer device and storage medium for generating data packets according to the embodiments of the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only for aiding in understanding the method and core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.

Claims (8)

1. A method of generating a data packet, comprising:
Acquiring data packet generation parameters;
if the data packet generation parameter is a global generation parameter, determining that the data packet generation type is a global generation type, wherein the global generation type is a data packet generation type for regenerating a new data packet, and the global generation parameter is all parameters required for generating the data packet;
If the data packet generation parameter is a local generation parameter, determining that the data packet generation type is a local generation type, wherein the local generation type is a data packet generation type modified on the basis of the original data packet to obtain a new data packet, and the local generation parameter is a part of parameters required for generating the data packet;
Acquiring a file path corresponding to the data packet generation type, acquiring an update content file from a storage position indicated by the file path, and determining the type of the update content file according to the suffix name of the update content file, wherein the update content file comprises a first update content file and a second update content file, and the first update content file is a content file required for generating a configuration file corresponding to the global generation type; the second updated content file is a content file required for generating a configuration file corresponding to the local generation type;
If the data packet generation type is a global generation type, generating a configuration file according to the first updated content file and the type of the first updated content file;
If the data packet generation type is a local generation type, acquiring a history configuration file, and generating a configuration file according to the history configuration file, the second updated content file and the type of the second updated content file;
And generating a data packet according to the configuration file.
2. The method for generating a data packet according to claim 1, wherein the acquiring the data packet generation parameters includes:
receiving a data packet generation request;
and calling the data packet generation parameters based on the data packet generation request.
3. The method according to claim 2, wherein the invoking the packet generation parameter based on the packet generation request includes:
Triggering an operation script file based on the data packet generation request;
and calling the data packet generation parameters based on the script file.
4. The method of generating a data packet according to claim 1, wherein generating a data packet according to the profile includes:
And compiling according to the configuration file to generate the data packet.
5. The method according to any one of claims 1-4, further comprising, after generating the data packet according to the configuration file:
Setting a version number for the data packet, and storing the data packet based on the version number.
6. A data packet generation apparatus, comprising:
the first acquisition module is used for acquiring the data packet generation parameters;
The determining module is used for determining that the data packet generation type is a global generation type if the data packet generation parameter is a global generation parameter, wherein the global generation type is a data packet generation type for regenerating a new data packet, the global generation parameter is all parameters required for generating the data packet, and determining that the data packet generation type is a local generation type if the data packet generation parameter is a local generation parameter, wherein the local generation type is a data packet generation type modified on the basis of an original data packet to obtain the new data packet, and the local generation parameter is a part of parameters required for generating the data packet;
The second acquisition module is used for acquiring a file path corresponding to the data packet generation type, acquiring an updated content file from a storage position indicated by the file path, and determining the type of the updated content file according to the suffix name of the updated content file, wherein the updated content file comprises a first updated content file and a second updated content file;
The first generation module is used for generating a configuration file according to the first updated content file and the type of the first updated content file if the data packet generation type is a global generation type, acquiring a historical configuration file if the data packet generation type is a local generation type, and generating the configuration file according to the historical configuration file, the second updated content file and the type of the second updated content file;
and the second generation module is used for generating a data packet according to the configuration file.
7. A computer device comprising a processor and a memory, the memory having stored therein a computer program, the processor executing the data packet generation method of any of claims 1 to 5 when invoking the computer program in the memory.
8. A storage medium storing a computer program to be loaded by a processor to perform the packet generation method of any one of claims 1 to 5.
CN202110559975.8A 2021-05-21 Data packet generation method and device, computer equipment and storage medium Active CN113268267B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110559975.8A CN113268267B (en) 2021-05-21 Data packet generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110559975.8A CN113268267B (en) 2021-05-21 Data packet generation method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113268267A CN113268267A (en) 2021-08-17
CN113268267B true CN113268267B (en) 2024-07-05

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111142903A (en) * 2019-12-23 2020-05-12 杭州安恒信息技术股份有限公司 Configuration file interactive updating method and device based on file comparison
CN112256321A (en) * 2020-11-18 2021-01-22 腾讯科技(深圳)有限公司 Static library packaging method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111142903A (en) * 2019-12-23 2020-05-12 杭州安恒信息技术股份有限公司 Configuration file interactive updating method and device based on file comparison
CN112256321A (en) * 2020-11-18 2021-01-22 腾讯科技(深圳)有限公司 Static library packaging method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111309335B (en) Compiling method and device of plug-in application and computer readable storage medium
CN111399840B (en) Module development method and device
CN108647032B (en) Application loading method and device, computer device and computer readable storage medium
CN109725923A (en) A kind of software light weight update method, device and equipment
CN110888658B (en) Method and device for dynamically changing function modules in application program and storage medium
CN112769706B (en) Componentized routing method and system
CN112783912B (en) Data processing method, device, computer equipment and storage medium
CN109816453B (en) Detection method and device for promotion resource link
CN113608742A (en) Detection method, code packet processing method, operation control method and computing device
CN110688320B (en) Global variable detection method and device and terminal equipment
CN113268267B (en) Data packet generation method and device, computer equipment and storage medium
CN116755788A (en) On-line rule modification method, device, equipment and storage medium
CN111488144A (en) Data processing method and equipment
CN113791809B (en) Application exception handling method and device and computer readable storage medium
CN116578282A (en) Code generation method, device, electronic equipment and medium
CN111090442A (en) Application updating method and device and storage medium
CN117170634A (en) Code compiling method and device, storage medium and electronic equipment
CN114721709A (en) Program package generation method, device, storage medium and computer equipment
CN115729590A (en) Service deployment method, device, equipment and computer readable storage medium
CN114860300A (en) Dependency configuration method and device, electronic equipment and storage medium
CN113268267A (en) Data packet generation method and device, computer equipment and storage medium
CN115964061A (en) Plug-in updating method and device, electronic equipment and computer readable storage medium
CN114237736A (en) Page resource loading method, system, device, computer equipment and storage medium
CN115033551A (en) Database migration method and device, electronic equipment and storage medium
CN113708971A (en) Openstack cloud platform deployment method and related device

Legal Events

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