CN114115855A - Code multiplexing method and device, computer readable storage medium and electronic equipment - Google Patents

Code multiplexing method and device, computer readable storage medium and electronic equipment Download PDF

Info

Publication number
CN114115855A
CN114115855A CN202110324470.3A CN202110324470A CN114115855A CN 114115855 A CN114115855 A CN 114115855A CN 202110324470 A CN202110324470 A CN 202110324470A CN 114115855 A CN114115855 A CN 114115855A
Authority
CN
China
Prior art keywords
service
function information
code
difference
public
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
CN202110324470.3A
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.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian Technology Co Ltd
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 Beijing Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202110324470.3A priority Critical patent/CN114115855A/en
Publication of CN114115855A publication Critical patent/CN114115855A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure relates to the field of computers, and provides a code multiplexing method, apparatus, computer-readable storage medium and electronic device, the method comprising: matching the service function information contained in the target service with the public code segments in the public code library to determine the public function information and the difference function information in the service function information, and configuring the difference code segments according to the difference function information; configuring service function information corresponding to a target service through an external configuration system, and generating a configuration interface; and calling a configuration interface, and loading a difference code segment corresponding to the difference function information and a public code segment corresponding to the public function information through the configuration interface. The method and the device can improve the reuse rate of the public codes and improve the development efficiency.

Description

Code multiplexing method and device, computer readable storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a code multiplexing method, a code multiplexing apparatus, a computer-readable storage medium, and an electronic device.
Background
With the development of computer technology, a large amount of code is usually written in the process of program development to meet the requirements of a project. Between projects, there are often one or more identical code segments, wasting technician time.
In the prior art, a code multiplexing technology is adopted, code segments with high utilization rate are extracted into public codes, the public codes are called at any time according to project requirements, and time cost and labor cost are saved. However, the code multiplexing technology can only multiplex code segments without difference, the code multiplexing performance is poor, and a large amount of codes still need to be written for different project requirements.
In view of this, there is a need in the art to develop a new code multiplexing method and apparatus.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a code multiplexing method, a code multiplexing apparatus, a computer-readable storage medium, and an electronic device, so as to improve the multiplexing rate of code segments at least to some extent.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to an aspect of the present disclosure, there is provided a code multiplexing method including: matching service function information contained in a target service with a public code segment in a public code library to determine public function information and difference function information in the service function information, and configuring a difference code segment according to the difference function information; configuring service function information corresponding to the target service through an external configuration system, and generating a configuration interface; and calling the configuration interface, and loading the difference code segment corresponding to the difference function information and the public code segment corresponding to the public function information through the configuration interface.
In some exemplary embodiments of the present disclosure, the common code segment includes a business function identification; matching the service function information contained in the target service with the common code segments in the common code base to determine the common function information and the difference function information in the service function information, wherein the method comprises the following steps: judging whether the service function information contained in the target service is matched with a service function identifier corresponding to a public code segment in the public code library; if yes, the service function information is judged to be the public function information; if not, the service function information is judged to be the difference function information.
In some exemplary embodiments of the present disclosure, the method further comprises: and configuring the difference code segments according to the difference function information, and storing the difference code segments into the public code base.
In some exemplary embodiments of the present disclosure, configuring service function information corresponding to the target service through an external configuration system includes: responding to the selection operation on the external configuration system, and configuring the service function information corresponding to the target service according to the selection operation.
In some exemplary embodiments of the present disclosure, the target service includes a plurality of sub-services; configuring service function information corresponding to the target service according to the selection operation, wherein the service function information comprises: determining a target sub-service among the plurality of sub-services according to a first selection operation; and determining the service function information corresponding to the target sub-service according to the second selection operation, and associating the target sub-service with the service function information corresponding to the target sub-service.
In some exemplary embodiments of the present disclosure, loading, through the configuration interface, a difference code segment corresponding to the difference function information and a common code segment corresponding to the common function information includes: responding to the trigger operation aiming at the target sub-service, and acquiring service function information corresponding to the target sub-service through a preset mapping relation; loading a difference code segment and a public code segment corresponding to the service function information of the target sub-service through the configuration interface, and operating the difference code segment and the public code segment corresponding to the service function information of the target sub-service; the preset mapping relation comprises an incidence relation between the target sub-service and the service function information corresponding to the target sub-service.
In some exemplary embodiments of the present disclosure, the method further comprises: and on an external configuration system, configuring the incidence relation between the target sub-service and the service function information corresponding to the target sub-service through front-end routing.
According to an aspect of the present disclosure, there is provided a code multiplexing apparatus including: the function matching module is used for matching the service function information contained in the target service with the public code segments in the public code library so as to determine the public function information and the difference function information in the service function information, and configuring the difference code segments according to the difference function information; the function configuration module is used for configuring the service function information corresponding to the target service through an external configuration system and generating a configuration interface; and the code loading module is used for calling the configuration interface and loading the difference code segment corresponding to the difference function information and the public code segment corresponding to the public function information through the configuration interface.
According to an aspect of the present disclosure, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the code multiplexing method as described in the above embodiments.
According to an aspect of the present disclosure, there is provided an electronic device including: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the code multiplexing method as described in the above embodiments.
As can be seen from the foregoing technical solutions, the code multiplexing method and apparatus, the computer-readable storage medium, and the electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
firstly, matching service function information contained in a target service with a common code segment in a common code library to determine common function information and difference function information in the service function information, and configuring a difference code segment according to the difference function information; then, configuring service function information corresponding to the target service through an external configuration system, and generating a configuration interface; and calling a configuration interface, and loading a difference code segment corresponding to the difference function information and a public code segment corresponding to the public function information through the configuration interface. The code multiplexing method can configure the service function information of the target service through the external configuration system, and is not associated with the codes in the public code library, so that the multiplexing rate of code fragments is improved, and the development efficiency is improved; moreover, the situation of code redundancy caused by multiplexing codes for multiple times is avoided, and the readability of the codes is enhanced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 schematically shows a flow diagram of a code multiplexing method according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of a method of running a code segment according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates an interface diagram for setting configuration items, according to a specific embodiment of the present disclosure;
FIG. 4 schematically illustrates an interface diagram of a requirements module, according to a particular embodiment of the present disclosure;
FIG. 5 schematically illustrates an interface diagram of a front-end routing configuration, according to a specific embodiment of the present disclosure;
FIG. 6 schematically shows a block diagram of a code multiplexing apparatus according to an embodiment of the present disclosure;
FIG. 7 schematically shows a block schematic of an electronic device according to an embodiment of the disclosure;
fig. 8 schematically shows a program product schematic according to an embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
In the related art, a non-differential code multiplexing technique is adopted, i.e. a repeated code segment or a non-differential code segment is extracted into a common module for code multiplexing. However, the code is poor in reusability, only code segments without differences can be reused, and a large number of codes need to be written for different project requirements. In addition, in the prior art, a differential configuration technology is also adopted, namely for codes which are different but need to be multiplexed, configuration items are designed for the different parts of the codes, and the codes are extracted from the unified configuration. However, because the readability of the configuration file generated by the differentiated configuration is poor, team development is not utilized, and along with iterative development of the project, the configuration file is larger and larger, the number of the different items is larger and larger, and the subsequent maintenance is difficult.
Based on the problems in the related art, in an embodiment of the present disclosure, a code multiplexing method is proposed, and fig. 1 shows a flowchart of the code multiplexing method, as shown in fig. 1, the code multiplexing method at least includes the following steps:
step S110: matching the service function information contained in the target service with the public code segments in the public code library to determine the public function information and the difference function information in the service function information, and configuring the difference code segments according to the difference function information;
step S120: configuring service function information corresponding to a target service through an external configuration system, and generating a configuration interface;
step S130: and calling a configuration interface, and loading a difference code segment corresponding to the difference function information and a public code segment corresponding to the public function information through the configuration interface to display the target service.
The code multiplexing method can configure the service function information of the target service through the external configuration system, and is not associated with the codes in the public code library, so that the multiplexing rate of code fragments is improved, and the development efficiency is improved; moreover, the situation of code redundancy caused by multiplexing codes for multiple times is avoided, and the readability of the codes is enhanced.
It should be noted that the code multiplexing method according to the exemplary embodiment of the present disclosure may be executed by a server, and a code multiplexing apparatus corresponding to the code multiplexing method may also be configured in the server. Furthermore, it should be understood that a terminal device (e.g., a mobile phone, a tablet, etc.) may also implement the steps of the code multiplexing method, and corresponding apparatuses may also be configured in the terminal device.
In order to make the technical solution of the present disclosure clearer, each step of the code multiplexing method is explained next.
In step S110, the service function information included in the target service is matched with the common code segment in the common code base to determine the common function information and the difference function information in the service function information, and the difference code segment is configured according to the difference function information.
In an exemplary embodiment of the present disclosure, the target service includes one or more service function information, the service function information includes a target service function required for implementing the target service, a target service function identifier corresponding to the target service function, and the like, the common code library includes one or more common code segments, each common code segment corresponds to one or more service function identifiers, and the common code segment can implement the service function represented by the corresponding service function identifier.
In an exemplary embodiment of the present disclosure, it is determined whether service function information included in a target service matches a service function identifier corresponding to a common code segment in a common code base; if the service function information contained in the target service is matched with the service function identifier corresponding to the public code segment in the public code library, judging that the service function information is public function information; and if the service function information contained in the target service is not matched with the service function identifier corresponding to the public code segment in the public code library, judging that the service function information is the difference function information.
Specifically, the service function information included in the target service includes one or more target service functions, each target service function corresponds to a target service function identifier, and each target service function identifier is matched with a service function identifier corresponding to a public code segment; if the target service function identification is matched with the service function identification corresponding to the public code segment, the target service function corresponding to the target service function identification is indicated to have the corresponding public code segment in a public code library, and the service function information corresponding to the target service function identification is configured into public function information; if the target service function identifier is not matched with the service function identifier corresponding to the public code segment, it is indicated that the target service function corresponding to the target service function identifier does not have the corresponding public code segment in the public code base, and the service function information corresponding to the target service function identifier is configured into a difference code segment.
In an exemplary embodiment of the present disclosure, if the service function information corresponding to the target service does not include the difference function information, directly configuring the service function information corresponding to the target service in the external configuration system, generating a configuration interface, calling the configuration interface, and running a common code segment corresponding to the service function information of the target service in the common code base.
In an exemplary embodiment of the present disclosure, the difference code sections are configured according to the difference function information and stored in the common code library.
Specifically, the difference code segment is configured according to the target service function and the target service function identifier in the difference function information, where the configured difference code segment may be implemented in any programming language, for example, C language, Java language, python language, and the like may be used, which is not specifically limited by this disclosure. After the difference code segment corresponding to the difference function information is configured, the difference code segment and the service function identifier corresponding to the difference code segment are stored in a public code base in a key value pair mode. For example, the service function identifier is stored in the common code base as a key value, and the difference code segment corresponding to the service function identifier is stored in the common code base as a value corresponding to the key value, so as to be used for multiplexing the difference code segment subsequently.
In step S120, the service function information corresponding to the target service is configured by the external configuration system, and a configuration interface is generated.
In an exemplary embodiment of the present disclosure, configuring service function information corresponding to a target service through an external configuration system includes: responding to the selection operation on the external configuration system, and configuring the service function information corresponding to the target service according to the selection operation.
The external configuration system can be a visualization configuration platform and also can be a code hosting platform. The external configuration system comprises a display interface, and on the display interface, a user can configure service function information corresponding to the target service through selection operation on the display interface. The external configuration system also comprises a plurality of service function identifications corresponding to the service function information.
Specifically, in the external configuration system, a target service function identifier corresponding to a target service is selected from a plurality of service function codes, and the target service function identifier is associated with the target service, so as to configure service function information corresponding to the target service according to the target service function identifier.
In addition, the selecting operation may be a triggering operation for a plurality of service function identifiers on the display interface, the triggering operation includes a contact triggering operation or a non-contact triggering operation, the non-contact triggering operation may be a floating touch operation, and the floating touch operation is a technology that may detect an operation of the operating medium in front of the display interface of the touch terminal by using capacitive touch sensing or a sensor (e.g., a light-sensitive sensor or an ultrasonic sensor) carried in the IPTV terminal. Certainly, the non-contact triggering operation may also be a non-contact operation in other manners, and the user may implement an interaction function with the terminal device without contacting the touch terminal. In addition, the operation medium for triggering the operation may be a finger of the user, or may be a touch pen, etc., which is not specifically limited in this disclosure.
In an exemplary embodiment of the present disclosure, a target sub-service is determined among a plurality of sub-services according to a first selection operation, and service function information corresponding to the target sub-service is determined according to a second selection operation, and the target sub-service and the service function information corresponding to the target sub-service are associated.
The target service comprises a plurality of sub-services, and each sub-service corresponds to one or more service function information. For example, if the target service is a website developed, the functional module included in the website is used as service function information of the target service, the website includes a plurality of webpages, each webpage corresponds to a sub-service, and the functional module in the webpage is service function information corresponding to the sub-service. A Uniform Resource Locator (URL) corresponding to the sub-service may be configured as the service identifier of the sub-service.
The display interface of the external configuration system comprises a first display area and a second display area, wherein the first display area displays the service identification of one or more sub-services in the target service, and the second display area displays one or more service function identifications. A first selection frame can be displayed in the first display area, and a user can display service identifications of one or more sub-services below the first selection frame by triggering the first selection frame; a second selection box may be displayed in the second display area for displaying one or more service function identifiers below the second selection box via the second selection box.
Specifically, in response to a first selection operation of service identifiers for one or more sub-services in the first display area, a service identifier corresponding to the first selection operation is used as a target sub-service identifier corresponding to a target sub-service. And responding to a second selection operation aiming at one or more service function identifiers in the second display area, and taking the service function identifier corresponding to the second selection operation as the service function identifier corresponding to the service function information of the target sub-service. And acquiring a code segment corresponding to the service function information of the target sub-service in a public code base according to the service function identifier corresponding to the service function information of the target sub-service, and configuring the target sub-service through the code segment corresponding to the service function information of the target sub-service.
In an exemplary embodiment of the present disclosure, on the external configuration system, the association relationship between the target sub-service and the service function information of the target sub-service is configured through the front-end route.
Specifically, the association relationship between the target sub-service and the service function information of the target sub-service may be configured by setting the routing name of the front-end route, the service identifier corresponding to the target sub-service, and the service function identifier corresponding to the service function information of the target sub-service. The front-end route configures basic logic of page jump in a webpage, and describes an association relationship between a URL (web address path) of the webpage and the front-end page, wherein the association relationship can be unidirectional, namely, the change of the URL causes the update of the front-end page (without refreshing the page).
In an exemplary embodiment of the present disclosure, a new configuration item is added to the external configuration system to generate a new API interface for calling the configuration item, and the configuration item can be used by calling the API interface in the front-end page. The front end, namely the foreground part of the website, runs on browsers such as a PC (personal computer) end and a mobile end and displays a webpage browsed by a user. With the development of internet technology, the application of HTML5, CSS3 and a front-end framework and the cross-platform response type webpage design can adapt to various screen resolutions and a proper dynamic effect design, and extremely high user experience is brought to a user. The API interface includes a number of predefined functions, or conventions for interfacing different components of a software system, for providing a set of routines that an application program and developer can access based on certain software or hardware without accessing source code or understanding details of internal working mechanisms.
In step S130, a configuration interface is called, and a difference code segment corresponding to the difference function information and a common code segment corresponding to the common function information are loaded through the configuration interface, so as to display the target service.
In an exemplary embodiment of the disclosure, fig. 2 shows a flowchart of a method for running a code segment, and as shown in fig. 2, the flowchart at least includes steps S210 to S220, which are described in detail as follows:
in step S210, in response to the trigger operation for the target sub-service, service function information corresponding to the target sub-service is obtained through a preset mapping relationship.
In an exemplary embodiment of the present disclosure, the triggering operation may be that the code corresponding to the target service includes the service identifier of the target sub-service, and the code corresponding to the target service is executed. And when the target sub-service is operated, determining the service function information of the target sub-service according to the incidence relation between the target sub-service and the service function information corresponding to the target sub-service.
The preset mapping relation comprises an incidence relation between the target sub-service and the service function information corresponding to the target sub-service.
In step S220, the difference code segment and the common code segment corresponding to the service function information of the target sub-service are loaded through the configuration interface, and the difference code segment and the common code segment corresponding to the service function information of the target sub-service are run.
In an exemplary embodiment of the present disclosure, a code segment corresponding to service function information of a target sub-service is loaded through a configuration interface, where the code segment corresponding to the service function information of the target sub-service includes a difference code segment and a common code segment, and the difference code segment and the common code segment corresponding to the service function information of the target sub-service are run to implement the target sub-service.
In an exemplary embodiment of the present disclosure, the code corresponding to the target service includes a service identifier of a sub-service and a configuration interface corresponding to the sub-service, and when the code of the target service is run, the code is run to a certain sub-service, and a difference code segment and/or a common code segment corresponding to service function information of the sub-service is called according to the configuration interface.
The code multiplexing technology in the embodiment of the disclosure can be applied to the fields of website development or webpage development, and the like, and then by taking the development scene of a prescription audit page of a hospital as an example, the prescription audit page of the existing hospital a includes a plurality of business functions, code segments of the business functions are stored in a public code library as public code segments, wherein the business functions of the prescription audit page of the hospital a include a prescription audit table component. The current target business is to develop a prescription audit page of a hospital B, and the hospital B requires a business function of removing a prescription audit table component on the basis of the prescription audit page of the hospital A.
Specifically, the process of configuring the prescription audit page of the hospital B is as follows:
firstly, a platform account number of a hospital B is used for logging in an external configuration system, all configuration items of a prescription auditing page of the hospital A are obtained, the configuration item of a prescription auditing table component in the prescription auditing page of the hospital A is extracted, and the system maintains the configuration items independently of internal codes of the hospital B.
Next, as shown in fig. 3, in the configuration item of the recipe table display configuration, this configuration item is closed. And generating a new configuration interface for all configuration items of the prescription auditing page.
And finally, adding a newly generated configuration interface into the internal code of the prescription auditing page of the hospital B, and returning a corresponding configuration item by the configuration interface according to the platform account number of the hospital B. At the moment, A, B hospitals use the same set of codes, but external interfaces are added, and development cost is reduced.
According to the method, after the common code iterates a plurality of versions, the original multiplexing code technology has the defects of code redundancy and poor readability, but the technology uses external configuration and is not related to the multiplexed code, so that the readability of the code is enhanced. When the existing personalized configuration already exists, the configuration item of the page resource positioning mark is checked firstly, and the configuration item is configured so as to achieve the multiplexing code with zero development cost.
Another specific embodiment of the present disclosure takes a filing webpage development scenario of a hospital as an example, and uses a configuration means of front-end routing to perform organization, combination and multiplexing for different code segments. In this embodiment, a set of hospital mobile end code base is developed, wherein code segments are divided according to different modules, as shown in fig. 4, the whole set of codes is uploaded to a common code base to be managed, and preparation is made for code multiplexing later.
The existing hospital C needs to develop a profiling webpage, and can use the code segments in the public code base to organize the code segments in the public code base in a front-end routing mode. Firstly, planning a route, and carrying out route configuration in an external configuration system; as shown in fig. 5, the code basic structure of the page route and the C hospital project is generated through vue scaffolds, and the route configuration is performed through inputting the route name and selecting the template operation in the route configuration.
Among them, vue scaffold refers to vue-cli, which is a tedious scaffold built quickly for single-page applications, which can easily create new applications and can be used to automatically generate vue and webpack project templates.
The embodiment is based on the downloading of the routing selected template as required, maintains the component library codes in the public code library, and multiplexes the codes of the component library through the dynamic loading of the routing configuration so as to achieve the purpose of multiplexing the code segments.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. The computer program, when executed by the CPU, performs the functions defined by the method provided by the present invention. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the method according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following describes embodiments of the apparatus of the present disclosure, which may be used to perform the code multiplexing method of the present disclosure. For details that are not disclosed in the embodiments of the apparatus of the present disclosure, please refer to the embodiments of the code multiplexing method described above in the present disclosure.
Fig. 6 schematically shows a block diagram of a code multiplexing apparatus according to one embodiment of the present disclosure.
Referring to fig. 6, a code multiplexing apparatus 600 according to an embodiment of the present disclosure, the code multiplexing apparatus 600 includes: a function matching module 601, a function configuration module 602, and a code loading module 603. Specifically, the method comprises the following steps:
a function matching module 601, configured to match service function information included in the target service with a common code segment in a common code base, to determine common function information and difference function information in the service function information, and configure a difference code segment according to the difference function information;
a function configuration module 602, configured to configure service function information corresponding to a target service through an external configuration system, and generate a configuration interface;
the code loading module 603 is configured to invoke a configuration interface, and load a difference code segment corresponding to the difference function information and a common code segment corresponding to the common function information through the configuration interface.
In an exemplary embodiment of the present disclosure, the common code segment includes a business function identification; the function matching module 601 may also be configured to determine whether service function information included in the target service matches a service function identifier corresponding to a public code segment in a public code library; if yes, the service function information is judged to be public function information; if not, the service function information is judged to be the difference function information.
In an exemplary embodiment of the present disclosure, the function configuration module 602 may be further configured to respond to a selection operation on the external configuration system, and configure service function information corresponding to the target service according to the selection operation.
In an exemplary embodiment of the present disclosure, the target service includes a plurality of sub-services; the function configuration module 802 may be further configured to determine a target sub-service among the plurality of sub-services according to the first selection operation, determine service function information corresponding to the target sub-service according to the second selection operation, and associate the target sub-service with the service function information corresponding to the target sub-service.
In an exemplary embodiment of the present disclosure, the function configuration module 602 may be further configured to respond to a trigger operation for a target sub-service, and obtain service function information corresponding to the target sub-service through a preset mapping relationship; loading a difference code segment and a common code segment corresponding to the service function information of the target sub-service through a configuration interface, and operating the difference code segment and the common code segment corresponding to the service function information of the target sub-service; the preset mapping relation comprises an incidence relation between the target sub-service and the service function information corresponding to the target sub-service.
In an exemplary embodiment of the present disclosure, the code multiplexing apparatus 600 further includes a routing configuration module (not shown in the figure), and the routing configuration module may be configured to configure, on the external configuration system, an association relationship between the target sub-service and the service function information corresponding to the target sub-service through a front-end route.
In an exemplary embodiment of the present disclosure, the code multiplexing apparatus 600 further includes a code storage module (not shown in the figure), and the code storage module may be configured to configure the difference code segments according to the difference function information and store the difference code segments into the common code base.
The specific details of each code multiplexing apparatus are already described in detail in the corresponding code multiplexing method, and therefore, the details are not repeated here.
It should be noted that although in the above detailed description several modules or units of the apparatus for performing are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 700 according to this embodiment of the invention is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, electronic device 700 is embodied in the form of a general purpose computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one memory unit 720, a bus 730 connecting different system components (including the memory unit 720 and the processing unit 710), and a display unit 740.
Wherein the storage unit stores program code that is executable by the processing unit 710 such that the processing unit 710 performs the steps according to various exemplary embodiments of the present invention as described in the above section "exemplary method" of the present specification. For example, the processing unit 710 may execute step S110 shown in fig. 1, match the service function information contained in the target service with the common code segments in the common code base to determine the common function information and the difference function information in the service function information, and configure the difference code segments according to the difference function information; step S120, configuring service function information corresponding to the target service through an external configuration system, and generating a configuration interface; step S130, calling a configuration interface, and loading a difference code segment corresponding to the difference function information and a common code segment corresponding to the common function information through the configuration interface.
The storage unit 720 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)7201 and/or a cache memory unit 7202, and may further include a read only memory unit (ROM) 7203.
The storage unit 720 may also include a program/utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 730 may be any representation of one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a viewer to interact with the electronic device 700, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 700 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 750. Also, the electronic device 700 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 760. As shown, the network adapter 760 communicates with the other modules of the electronic device 700 via the bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 8, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a 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.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and 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 user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.

Claims (10)

1. A method for code multiplexing, comprising:
matching service function information contained in a target service with a public code segment in a public code library to determine public function information and difference function information in the service function information, and configuring a difference code segment according to the difference function information;
configuring service function information corresponding to the target service through an external configuration system, and generating a configuration interface;
and calling the configuration interface, and loading the difference code segment corresponding to the difference function information and the public code segment corresponding to the public function information through the configuration interface.
2. The code multiplexing method according to claim 1, wherein the common code segment includes a service function identification;
matching the service function information contained in the target service with the common code segments in the common code base to determine the common function information and the difference function information in the service function information, wherein the method comprises the following steps:
judging whether the service function information contained in the target service is matched with a service function identifier corresponding to a public code segment in the public code library;
if yes, the service function information is judged to be the public function information;
if not, the service function information is judged to be the difference function information.
3. The code multiplexing method according to claim 2, wherein the method further comprises:
and configuring the difference code segments according to the difference function information, and storing the difference code segments into the public code base.
4. The code multiplexing method according to claim 1, wherein configuring the service function information corresponding to the target service through an external configuration system comprises:
responding to the selection operation on the external configuration system, and configuring the service function information corresponding to the target service according to the selection operation.
5. The code multiplexing method according to claim 4, wherein the target service comprises a plurality of sub-services;
configuring service function information corresponding to the target service according to the selection operation, wherein the service function information comprises:
determining a target sub-service among the plurality of sub-services according to a first selection operation; and
and determining the service function information corresponding to the target sub-service according to the second selection operation, and associating the target sub-service with the service function information corresponding to the target sub-service.
6. The code multiplexing method according to claim 5, wherein loading, via the configuration interface, a differential code segment corresponding to the differential function information and a common code segment corresponding to the common function information comprises:
responding to the trigger operation aiming at the target sub-service, and acquiring service function information corresponding to the target sub-service through a preset mapping relation;
loading a difference code segment and a public code segment corresponding to the service function information of the target sub-service through the configuration interface, and operating the difference code segment and the public code segment corresponding to the service function information of the target sub-service;
the preset mapping relation comprises an incidence relation between the target sub-service and the service function information corresponding to the target sub-service.
7. The code multiplexing method according to claim 6, wherein the method further comprises:
and configuring the incidence relation between the target sub-service and the service function information corresponding to the target sub-service on the external configuration system through front-end routing.
8. A code multiplexing apparatus, comprising:
the function matching module is used for matching the service function information contained in the target service with the public code segments in the public code library so as to determine the public function information and the difference function information in the service function information, and configuring the difference code segments according to the difference function information;
the function configuration module is used for configuring the service function information corresponding to the target service through an external configuration system and generating a configuration interface;
and the code loading module is used for calling the configuration interface and loading the difference code segment corresponding to the difference function information and the public code segment corresponding to the public function information through the configuration interface.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the code multiplexing method according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the code multiplexing method of any one of claims 1 to 7.
CN202110324470.3A 2021-03-26 2021-03-26 Code multiplexing method and device, computer readable storage medium and electronic equipment Pending CN114115855A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110324470.3A CN114115855A (en) 2021-03-26 2021-03-26 Code multiplexing method and device, computer readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110324470.3A CN114115855A (en) 2021-03-26 2021-03-26 Code multiplexing method and device, computer readable storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114115855A true CN114115855A (en) 2022-03-01

Family

ID=80359449

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110324470.3A Pending CN114115855A (en) 2021-03-26 2021-03-26 Code multiplexing method and device, computer readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114115855A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114915666A (en) * 2022-05-13 2022-08-16 北京有竹居网络技术有限公司 Interface adaptation method, device, storage medium and program product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114915666A (en) * 2022-05-13 2022-08-16 北京有竹居网络技术有限公司 Interface adaptation method, device, storage medium and program product

Similar Documents

Publication Publication Date Title
EP3876116B1 (en) Method and apparatus for running mini program, electronic device, and storage medium
US10565293B2 (en) Synchronizing DOM element references
US9720908B2 (en) Generating a context for translating strings based on associated application source code and markup
CN107122172B (en) Light application processing method, light application running method, light application equipment and light application equipment
CN108509207A (en) The cross-system of WEB application program is installed
CN113031946B (en) Method and device for rendering page component
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN111125064A (en) Method and device for generating database mode definition statement
CN112015468A (en) Interface document processing method and device, electronic equipment and storage medium
US11604662B2 (en) System and method for accelerating modernization of user interfaces in a computing environment
CN112835568A (en) Project construction method and device
US20190392024A1 (en) Digital Content Editing of a Document Object Model (DOM)
CN114115855A (en) Code multiplexing method and device, computer readable storage medium and electronic equipment
CN112926008A (en) Method and device for generating form page, electronic equipment and storage medium
CN111198738A (en) Mobile terminal page display method and device and electronic equipment
US20190042549A1 (en) Method and apparatus for building pages, apparatus and non-volatile computer storage medium
CN110580156A (en) Page processing method and device and electronic equipment
US20150378688A1 (en) Developing rich internet application
CN112181408A (en) Method and device for displaying view list on front page of application program
CN105739717A (en) Information input method and device
CN113656041A (en) Data processing method, device, equipment and storage medium
CN113312900A (en) Data verification method and device
CN108170557B (en) Method and apparatus for outputting information
CN114254232A (en) Cloud product page generation method and device, computer equipment and storage medium
CN113703638A (en) Data management page processing method and device, electronic equipment and storage medium

Legal Events

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