Service implementation method and device

Through the business implementation method based on the atomic particle size of attribute information, the problems of complex data structure and poor code readability caused by the addition of new business fields in the prior art are solved, and efficient business logic multiplexing and code utilization are achieved.

CN120179238APending Publication Date: 2025-06-20JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311754362.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-19
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

When the existing technology adds new business fields, it leads to complex data structures, poor code readability, and redundant business logic and code segments with high similarity.

Method used

Using a business implementation method based on the atomic particle size of attribute information, we mark the business, generate a label set, and find and instantiate the corresponding atomic policies from the preset atomic policy factory, establish a logical relationship between labels, and execute instantiated code to realize the business.

Benefits of technology

Maximize the reuse of atomic strategies, improve the utilization rate of code segments, simplify business logic, improve code readability and maintenance, and improve business implementation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179238A_ABST
    Figure CN120179238A_ABST
Patent Text Reader

Abstract

The invention discloses a business implementation method and device, and relates to the technical field of computers. A specific embodiment of the method comprises the following steps: in response to a received implementation request of a service, marking the service according to attribute information in the service to obtain a label set of the service; according to labels in the label set, searching a corresponding atomic strategy from a preset atomic strategy factory, and performing instantiation processing on the atomic strategy to obtain instantiation codes corresponding to the labels; according to a preset general template, establishing a logical relationship among the tags in the tag set; and executing the instantiation code corresponding to each label in the label set according to the logic relationship to realize the service. According to the implementation mode, service implementation based on the attribute information atomic granularity is achieved, the atomic strategy is reused to the maximum degree, the utilization rate of the code segment is improved, the implementation logic between the attribute information is clear, maintenance is convenient, and the service implementation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a method and apparatus for implementing a service. Background Art

[0002] In the existing service logic implementation method, different service fields are usually used to define corresponding service types. For example, the order payment method of the order service is represented by orderpaytype, and then based on the service function, each field with a specific meaning is logically assembled and processed using a programming language to obtain the implementation code of the service.

[0003] In the process of implementing the present invention, the inventors found the following problems in the prior art:

[0004] When new service fields need to be added, the existing implementation method will make the data structure complex and the code readability poor. Especially when the service logic corresponding to the newly added service field is the same as the service logic in the current code, there will be redundant service logic and highly similar code segments in the service implementation code. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a method and apparatus for implementing a service. Based on the service implementation at the atomic granularity of attribute information, not only the atomic policies are reused to the greatest extent, improving the utilization rate of code segments, especially in multi-dimensional service scenarios, such as different payment methods and different fulfillment methods in the order service, where there are multiple attribute values corresponding to the attribute information; but also the implementation logic between each attribute information is clear, facilitating maintenance and improving the service implementation efficiency.

[0006] To achieve the above object, according to one aspect of the embodiments of the present invention, a method for implementing a service is provided, including:

[0007] In response to receiving a service implementation request, label the service according to the attribute information in the service to obtain a label set of the service;

[0008] According to the labels in the label set, find corresponding atomic policies from a preset atomic policy factory and perform instantiation processing on the atomic policies to obtain instantiated code corresponding to the labels;

[0009] Establish the logical relationship between each label in the label set according to a preset general template;

[0010] Execute the instantiated code corresponding to each label in the label set according to the logical relationship to implement the service.

[0011] Optionally, the tags in the tag set have position information; tagging the service according to the attribute information in the service includes: determining the position information of the tag corresponding to the attribute information according to the attribute name of the attribute information and combining with a preset tagging specification; determining the tag stored at the position information according to the attribute value of the attribute information.

[0012] Optionally, determining the tag stored at the position information according to the attribute value of the attribute information includes: parsing the attribute value according to a pre-configured configuration file; obtaining the corresponding tag according to the parsing result, and storing the tag at the position information of the tag set.

[0013] Optionally, before looking up the corresponding atomic policy from a preset atomic policy factory according to the tags in the tag set, the method further includes: defining atomic policies corresponding to respective attribute information with the attribute information of the service as a dimension, and constructing an atomic policy factory; determining the identifier of the atomic policy according to the attribute information corresponding to the atomic policy and a preset tagging specification, so as to look up the corresponding atomic policy from the atomic policy factory according to the tags in the tag set.

[0014] Optionally, before performing instantiation processing on the atomic policy, the method further includes: determining at least one implementation manner corresponding to the atomic policy; registering a policy adapter corresponding to the atomic policy according to the implementation manner; performing instantiation processing on the atomic policy, including: performing instantiation of the atomic policy through the adaptation of the tag and the policy adapter.

[0015] Optionally, in the case where the corresponding atomic policy is not found in the atomic policy factory, the method further includes: determining a reference atomic policy from the atomic policy factory, and processing the reference atomic policy through a hook method to obtain the atomic policy corresponding to the tag.

[0016] Optionally, the tag set of the service has version information; the method further includes: in response to receiving a request for updating the attribute information of the service, tagging the service according to the updated service attribute information to obtain a corresponding updated tag set, and recording the version information of the updated tag set.

[0017] According to a second aspect of the embodiments of the present invention, there is provided an apparatus for implementing a service, including:

[0018] A tag set generation module, configured to, in response to receiving a service implementation request, tag the service according to the attribute information in the service to obtain a tag set of the service;

[0019] An atomic policy processing module, configured to find a corresponding atomic policy from a preset atomic policy factory according to the labels in the label set, and perform instantiation processing on the atomic policy to obtain instantiated code corresponding to the labels;

[0020] A logical relationship determination module, configured to establish a logical relationship between each label in the label set according to a preset general template;

[0021] A service implementation module, configured to execute the instantiated code corresponding to each label in the label set according to the logical relationship to implement the service.

[0022] According to a third aspect of an embodiment of the present invention, there is provided an electronic implementation device for a service, including:

[0023] One or more processors;

[0024] A storage device, configured to store one or more programs,

[0025] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.

[0026] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, the method provided in the first aspect of the embodiment of the present invention is implemented.

[0027] One embodiment of the present invention has the following advantages or beneficial effects: by responding to a received service implementation request, tagging the service according to the attribute information in the service to obtain a label set of the service; finding a corresponding atomic policy from a preset atomic policy factory according to the labels in the label set, and performing instantiation processing on the atomic policy to obtain instantiated code corresponding to the labels; establishing a logical relationship between each label in the label set according to a preset general template; executing the instantiated code corresponding to each label in the label set according to the logical relationship to implement the service, an atomic-granularity service implementation method based on attribute information is realized, which not only maximally reuses atomic policies and improves the utilization rate of code segments, but also has clear implementation logic between each attribute information, is easy to maintain, and improves the service implementation efficiency. Description of the Drawings

[0028] The drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Among them:

[0029] Figure 1 is a schematic diagram of the main process of the service implementation method according to an embodiment of the present invention;

[0030] Figure 2It is a registration schematic diagram of the policy adapter according to an embodiment of the present invention;

[0031] Figure 3 It is a schematic diagram of the determination process of the instantiation code according to an embodiment of the present invention;

[0032] Figure 4 It is a schematic diagram of the implementation process of the order business according to an embodiment of the present invention;

[0033] Figure 5 It is a schematic diagram of the principle of the implementation method of the business according to an embodiment of the present invention;

[0034] Figure 6 It is a schematic diagram of the main modules of the business implementation device according to an embodiment of the present invention;

[0035] Figure 7 It is an exemplary system architecture diagram to which an embodiment of the present invention can be applied;

[0036] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. Detailed implementation manners

[0037] It should be noted that in the technical solution of the present invention, in terms of the collection / collection, update, analysis, use, transmission, storage, etc. of the user's personal information involved, they all comply with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside these legal uses, etc., and are subject to the supervision and management of the national regulatory authorities. Necessary measures should be taken for the user's personal information to selectively prevent the use or access to personal information data to prevent illegal access to such personal information data, ensure that the personnel with the right to access personal information data comply with the provisions of relevant laws and regulations, and ensure the security of the user's personal information. In addition, once these user personal information data are no longer needed, the risk should be minimized by restricting or even prohibiting data collection and / or deleting the data.

[0038] The following describes exemplary embodiments of the present invention with reference to the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described here without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.

[0039] In the current business implementation method, when new business fields need to be added, the data structure of the code becomes complex and the code readability is poor. Especially when the business logic corresponding to the newly added business field is the same as the business logic in the current code, there will be redundant business logic and highly similar code segments in the business implementation code, which is not conducive to improving the efficiency of business implementation.

[0040] To solve the above problems existing in the prior art, the present invention proposes a business implementation method. Taking the attribute information of the business as the atomic granularity, constructing atomic policies corresponding to the attribute information, marking the business according to the attribute information of the business to generate a tag set with business characteristics, then obtaining the corresponding atomic policies based on the tag set, and finally executing the corresponding atomic policies according to the logical relationship of each tag to achieve the purpose of business implementation. It realizes business implementation based on the atomic granularity of attribute information, not only maximally reuses the atomic policies and improves the utilization rate of code segments, especially in multi-dimensional business scenarios, such as different payment methods and different fulfillment methods in the order business, where there are multiple attribute values corresponding to the attribute information; moreover, the implementation logic between each attribute information is clear, facilitating maintenance and improving the efficiency of business implementation.

[0041] Figure 1 It is a schematic diagram of the main process of the business implementation method according to an embodiment of the present invention. As Figure 1 shown, the business implementation method of the embodiment of the present invention includes the following steps S101 to step S104.

[0042] Step S101, in response to receiving a business implementation request, mark the business according to the attribute information in the business to obtain a tag set of the business.

[0043] Specifically, the attribute information of the business is the data basis for business implementation. The embodiment of the present invention aims to refine the existing business function-based implementation method into an attribute information-based implementation method and convert each attribute information involved in the business into the form of corresponding tags. For example, in the order business, the usually included attribute information has transaction item attributes, payment methods, fulfillment methods, etc. Assign these attribute information to corresponding tags to obtain the tag set of the order business.

[0044] According to an embodiment of the present invention, the tags in the tag set have position information; marking the business according to the attribute information in the business includes: determining the position information of the tag corresponding to the attribute information according to the attribute name of the attribute information in combination with a preset tagging specification; determining the tag stored in the position information according to the attribute value of the attribute information.

[0045] Specifically, considering that the attribute information includes an attribute name and an attribute value, the attribute name is the transaction item attribute mentioned above, and the corresponding attribute values are physical items and virtual items. Since a label generally represents a piece of information, the embodiments of the present invention assign location information to the label for representing the attribute name. Of course, there must be a labeling specification to stipulate the attribute name represented by each location information. For example, it is stipulated that the location information of the label corresponding to the transaction item attribute is the first position. According to the attribute name and the labeling specification, the location information of the label corresponding to the attribute information can be determined; then the label determined by the attribute value is stored at the corresponding position. It can be understood that the label set composed of the labels corresponding to each attribute information can exist in the form of an element set, with each label corresponding to a location information; it can also be a string, with the corresponding labels concatenated according to the location information of each label; it can also be a two-level label representation, with the first level representing the attribute name and the second level representing the attribute value. For example, A-1, where A represents the attribute name and 1 represents the attribute value. There are various representation methods for labels, and the embodiments of the present invention do not make specific limitations.

[0046] According to another embodiment of the present invention, determining the label stored in the location information according to the attribute value of the attribute information includes: parsing the attribute value according to a pre-configured configuration file; obtaining the corresponding label according to the parsing result, and storing the label at the location information of the label set.

[0047] Specifically, for the method of determining the label content of the attribute information, the embodiments of the present invention pre-configure a relevant configuration file, stipulating the specific representation of the labels corresponding to various attribute values, or stipulating a rule for determining the label according to the attribute value of the attribute information. For example, for those with only two attribute values, they can be uniformly represented by 0 and 1, where 1 represents the default attribute value. According to the configuration file, the attribute value is parsed, and then according to the parsing result, the label representation corresponding to the attribute value can be determined. The determined label representation is stored according to the location information determined above, and thus the label corresponding to the attribute information is obtained. Similarly, each attribute information included in the service is represented in the form of a label, and a label set of the service is obtained.

[0048] Step S102: Search for the corresponding atomic policy from a preset atomic policy factory according to the label in the label set, and perform instantiation processing on the atomic policy to obtain the instantiated code corresponding to the label.

[0049] Specifically, in the embodiments of the present invention, the attribute information of the service is characterized as tags, and one type of attribute information corresponds to one type of policy execution code. Since the attribute information is the finest-grained level that cannot be further decomposed for the service, the corresponding policy execution code in the embodiments of the present invention is called an atomic policy. The atomic policy of the attribute information can be obtained through the position information of the tag, and then the atomic policy can be instantiated according to the specific content of the tag to obtain the instantiation code of each tag.

[0050] From the process of determining the instantiation code by the tags in the embodiments of the present invention, it can be seen that the atomic policy corresponds to the attribute name of the attribute information, such as the trading item attribute policy, payment policy, amount calculation policy, etc. The attribute value guides the instantiation of the atomic policy. That is, the best usage scenario of the embodiments of the present invention is a service with multi-dimensional attribute values. For example, in the order service, it involves different trading item sources (self-operated / external merchants), different payment methods (cash / points / installment), different fulfillment methods (pick-up / logistics delivery), different trading item attributes (physical / virtual), etc. In such a multi-dimensional service scenario, the atomic policy can be reused to the greatest extent, saving resources and improving efficiency.

[0051] According to an embodiment of the present invention, before looking up the corresponding atomic policy from a preset atomic policy factory according to the tags in the tag set, the method further includes: defining the atomic policies corresponding to each attribute information with the attribute information of the service as the dimension, and constructing an atomic policy factory; determining the identifier of the atomic policy according to the attribute information corresponding to the atomic policy and a preset tagging specification, so as to look up the corresponding atomic policy from the atomic policy factory according to the tags in the tag set.

[0052] Specifically, before looking up the corresponding atomic policy from a preset atomic policy factory according to the tags in the tag set, define the atomic policies corresponding to each attribute information as needed, that is, first clarify various common attribute information, and define the corresponding logical processing code, that is, the atomic policy, with the attribute information as the dimension to obtain an atomic policy factory. Then, according to the attribute name of the attribute information corresponding to each atomic policy and in combination with the tagging specification, determine the identifier of each atomic policy, so that the corresponding atomic policy can be looked up from the atomic policy factory according to the position information in the tag.

[0053] According to another embodiment of the present invention, before performing the instantiation process on the atomic policy, the method further includes: determining at least one implementation manner corresponding to the atomic policy; registering a policy adapter corresponding to the atomic policy according to the implementation manner; and performing the instantiation process on the atomic policy, including: instantiating the atomic policy through the adaptation of the tag and the policy adapter.

[0054] Specifically, the instantiation of the atomic policy in the embodiments of the present invention is achieved by constructing a policy adapter. Before performing the instantiation process on the atomic policy, the implementation methods of each atomic policy are determined. Essentially, this is the different implementations of the atomic policy for different attribute values under the attribute name. For multi-dimensional business scenarios, an atomic policy corresponds to multiple implementation methods. According to the implementation methods corresponding to the atomic policy, the corresponding policy adapters are registered. In this way, when instantiating the atomic policy, the instantiation of the atomic policy can be achieved by adapting through the policy adapter corresponding to the label. Specifically, it can be adapted in the policy adapter according to the attribute value represented by the label to determine the instantiation code corresponding to the label.

[0055] Figure 2 It is a schematic diagram of the registration of the policy adapter in the embodiments of the present invention. The implementation methods corresponding to the atomic policy are Policy Implementation A, Policy Implementation B,..., Policy Implementation N. According to the three implementation methods of this atomic policy, the policy adapter corresponding to this atomic policy is registered. Correspondingly, this policy adapter can be understood as including Policy Adapter A, Policy Adapter B, and Policy Adapter N to adapt to the corresponding implementation methods A, B,..., N.

[0056] Figure 3 It is a schematic diagram of the determination process of the instantiation code in the embodiments of the present invention. According to the address attribute information of the business, a corresponding label is generated, and the corresponding atomic policy obtained is the address policy. Then, according to whether the attribute value in the address attribute information is that physical objects need to submit address information or virtual items do not require address information, the instantiation code of this label is determined; according to the inventory attribute information of the business, a corresponding label is generated, and the corresponding atomic policy obtained is the inventory policy. Then, according to whether the attribute value in the inventory attribute information is general inventory or proprietary inventory at the negotiated price, the instantiation code of this label is determined; according to the price attribute information of the business, a corresponding label is generated, and the corresponding atomic policy obtained is the price policy. Then, according to whether the attribute value in the price attribute information is the general price, the N yuan purchase rule, or the N yuan purchase rule supporting vouchers, the instantiation code of this label is determined; similarly, according to the transaction item attribute information, a corresponding label is generated, and the corresponding atomic policy obtained is the item attribute policy. Then, according to whether the attribute value in the transaction item attribute information is a physical item or a virtual item, the instantiation code of this label is determined; for the freight attribute, marketing attribute, order amount attribute, financial attribute, payment attribute, and merchant attribute in the figure, the corresponding instantiation codes are determined in a similar manner as above.

[0057] According to another embodiment of the present invention, in the case where the corresponding atomic policy is not found in the atomic policy factory, the method further includes: determining a reference atomic policy from the atomic policy factory, and processing the reference atomic policy through a hook method to obtain the atomic policy corresponding to the label.

[0058] Specifically, considering that for newly added attribute information, there may be no corresponding atomic policy in the existing atomic policy factory, or individual atomic policies may be missed during the construction of the atomic policy factory. When the corresponding atomic policy is not found in the atomic policy factory according to the label, a reference attribute information with a certain similarity to the attribute information corresponding to the label can be determined, the corresponding reference atomic policy can be found from the atomic policy factory according to the reference attribute information, and then the obtained reference atomic policy is processed through the hook method to obtain the atomic policy corresponding to the label. This standard and moderately flexible atomic policy determination method can be applied to more business scenarios.

[0059] Step S103: Establish the logical relationship between the labels in the label set according to a preset general template.

[0060] Specifically, the implementation logic of the business is generally common. For example, the implementation process of the order business is to determine user information, transaction item information, supplier information, and payment information, and generate an order based on this information. These process nodes correspond to various attribute information, and correspondingly different labels. When receiving a business implementation request, the general template of the business is directly retrieved by calling an interface. According to the obtained general template, the logical relationship between the labels in the label set can be obtained, which is equivalent to associating each label to implement the business function or business process.

[0061] Figure 4 It is a schematic diagram of the implementation process of the order business in the embodiment of the present invention. Obtain the user attribute information, transaction item attribute information, transaction item channel and supplier attribute information, and marketing attribute information of the order business; label the order business according to these attribute information to obtain the label set of the order business; according to each label in the label set, determine the instantiation code of each label. For the label for which the atomic policy is not found, the corresponding instantiation code can be obtained by processing the determined reference atomic policy through the hook method; finally, according to the logical relationship between the labels, the instantiation code of the order business is obtained.

[0062] Step S104: Execute the instantiation code corresponding to each label in the label set according to the logical relationship to implement the business.

[0063] Specifically, based on the logical relationships between the various tags in the determined tag set described above, the instantiation code corresponding to each tag is executed, implementing the execution of the business functions at the granularity of attribute information. It can be understood that since the tag set of the business represents the characteristic attributes of the business, the tag set can not only be used for the execution of the business, but also provide the required information for other related businesses. Other related businesses only need to obtain the tag set to obtain the attribute information of the business, improving the information interaction efficiency.

[0064] According to an embodiment of the present invention, the tag set of the business has version information; the method further includes: in response to receiving a request for updating the attribute information of the business, tagging the business according to the updated business attribute information to obtain a corresponding updated tag set, and recording the version information of the updated tag set.

[0065] Specifically, considering different application scenarios, the attribute information of the business may change. For example, in a test scenario, logical functions may be executed for some of the concerned attribute information in the business. The embodiment of the present invention assigns version information to the tag set of the business, obtains the corresponding business attribute information according to the received update request, tags according to the obtained business attribute information, and records the version information of the tag set obtained by tagging, so as to distinguish the different compositions of attribute information corresponding to the business in different application scenarios, and it is also convenient for the maintenance and traceability of the tag set.

[0066] Figure 5 It is a schematic diagram of the principle of the implementation method of the business in the embodiment of the present invention. The atomic policy factory provides support for atomic policies for the business, including atomic policies corresponding to various common attribute information, such as the address policy, transaction item attribute policy, inventory policy, payment policy, etc. in the figure. The configuration file serves for tagging the attribute information, and the tag set of the business is obtained through tagging. According to the tags in the tag set, the corresponding atomic policies and the corresponding instantiation code are obtained from the atomic policy factory. Then, through a general template with the attribute information of the business as the dimension, which is determined by the type of the business and the requirements of the business, the logical relationships between the various tags are obtained, so as to execute the corresponding instantiation code according to the logical relationships to implement the business.

[0067] Figure 6 It is a schematic diagram of the main modules of the business implementation device according to an embodiment of the present invention. As Figure 6 shown, the business implementation device 600 mainly includes a tag set generation module 601, an atomic policy processing module 602, a logical relationship determination module 603, and a business implementation module 604.

[0068] A tag set generation module 601, configured to, in response to receiving an implementation request of a service, tag the service according to attribute information in the service to obtain a tag set of the service;

[0069] An atomic policy processing module 602, configured to find a corresponding atomic policy from a preset atomic policy factory according to tags in the tag set, and perform instantiation processing on the atomic policy to obtain instantiated code corresponding to the tag;

[0070] A logical relationship determination module 603, configured to establish a logical relationship between each tag in the tag set according to a preset general template;

[0071] A service implementation module 604, configured to execute the instantiated code corresponding to each tag in the tag set according to the logical relationship to implement the service.

[0072] According to an embodiment of the present invention, tags in the tag set have position information; the tag set generation module 601 is further configured to: determine position information of a tag corresponding to the attribute information according to an attribute name of the attribute information in combination with a preset tagging specification; determine a tag in which the position information is stored according to an attribute value of the attribute information.

[0073] According to another embodiment of the present invention, the tag set generation module 601 is further configured to: parse the attribute value according to a pre-configured configuration file; obtain a corresponding tag according to a parsing result, and store the tag at the position information of the tag set.

[0074] According to still another embodiment of the present invention, the service implementation device 600 further includes an atomic policy factory construction module (not shown in the figure), configured to: before finding a corresponding atomic policy from a preset atomic policy factory according to tags in the tag set, define atomic policies corresponding to respective attribute information with the attribute information of the service as a dimension, and construct an atomic policy factory; determine an identifier of the atomic policy according to the attribute information corresponding to the atomic policy and a preset tagging specification, so as to find a corresponding atomic policy from the atomic policy factory according to tags in the tag set.

[0075] According to yet another embodiment of the present invention, the service implementation device 600 further includes a policy adapter registration module (not shown in the figure), configured to: before performing instantiation processing on the atomic policy, determine at least one implementation manner corresponding to the atomic policy; register a policy adapter corresponding to the atomic policy according to the implementation manner; the atomic policy processing module 602 is further configured to: perform instantiation of the atomic policy through adaptation of the tag and the policy adapter.

[0076] According to another embodiment of the present invention, the implementation device 600 of the service further includes a policy processing module (not shown in the figure), which is configured to: in the case where the corresponding atomic policy is not found in the atomic policy factory, determine a reference atomic policy from the atomic policy factory, and process the reference atomic policy through a hook method to obtain the atomic policy corresponding to the label.

[0077] According to still another embodiment of the present invention, the label set of the service has version information; the implementation device 600 of the service further includes an attribute update module (not shown in the figure), which is configured to: in response to receiving a request for updating the attribute information of the service, perform tagging on the service according to the updated service attribute information to obtain a corresponding updated label set, and record the version information of the updated label set.

[0078] Figure 7 It is an exemplary system architecture diagram to which the embodiments of the present invention can be applied.

[0079] As Figure 7 shown, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is used to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0080] Users can use the terminal devices 701, 702, 703 to interact with the server 705 through the network 704 to receive or send messages, etc. Various communication client applications, such as service implementation applications (only for example), may be installed on the terminal devices 701, 702, 703.

[0081] The terminal devices 701, 702, 703 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, laptop portable computers, and desktop computers, etc.

[0082] The server 705 may be a server that provides various services, such as a background management server (only an example) that supports the services performed by the user using the terminal devices 701, 702, and 703. The background management server may, in response to receiving a service implementation request, label the service according to the attribute information in the service to obtain a label set of the service; find corresponding atomic policies from a preset atomic policy factory according to the labels in the label set, and perform instantiation processing on the atomic policies to obtain instantiated codes corresponding to the labels; establish logical relationships between the labels in the label set according to a preset general template; execute the instantiated codes corresponding to the labels in the label set according to the logical relationships to implement the service and other processing, and feedback the processing result (such as service implementation code, etc.--only an example) to the terminal device.

[0083] It should be noted that the service implementation method provided by the embodiments of the present invention is generally executed by the server 705. Correspondingly, the service implementation device is generally disposed in the server 705.

[0084] It should be understood that Figure 7 the numbers of terminal devices, networks, and servers in

[0085] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers. Figure 8 Figure 8

[0086] Figure 8 As

[0087] shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage section 808 into the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.

[0087] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. as well as a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as required. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 810 as required so that a computer program read therefrom is installed into the storage section 808 as required.

[0088] Specifically, according to the embodiments disclosed by the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed by the present invention include a computer program product which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 809, and / or installed from the removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, the above functions defined in the system of the present invention are performed.

[0089] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and the combination of blocks in a block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.

[0091] The units involved in the embodiments of the present invention can be implemented in software or in hardware. The described units can also be provided in a processor. For example, it can be described as: a processor includes a tag set generation module, an atomic policy processing module, a logical relationship determination module, and a service implementation module.

[0092] Among them, the names of these modules do not constitute a limitation on the modules themselves in some cases. For example, the logical relationship determination module can also be described as "a module for establishing the logical relationship between the tags in the tag set according to a preset general template".

[0093] On the other hand, the present invention also provides a computer-readable medium, which can be included in the device described in the embodiments; or can exist alone without being assembled into the device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device includes: in response to receiving a service implementation request, marking the service according to the attribute information in the service to obtain a tag set of the service; according to the tags in the tag set, looking up corresponding atomic policies from a preset atomic policy factory and performing instantiation processing on the atomic policies to obtain instantiated codes corresponding to the tags; establishing the logical relationship between the tags in the tag set according to a preset general template; and executing the instantiated codes corresponding to the tags in the tag set according to the logical relationship to implement the service.

[0094] According to the technical solution of the embodiments of the present invention, the following advantages or beneficial effects are achieved: by in response to receiving a service implementation request, marking the service according to the attribute information in the service to obtain a tag set of the service; according to the tags in the tag set, looking up corresponding atomic policies from a preset atomic policy factory and performing instantiation processing on the atomic policies to obtain instantiated codes corresponding to the tags; establishing the logical relationship between the tags in the tag set according to a preset general template; and executing the instantiated codes corresponding to the tags in the tag set according to the logical relationship to implement the service, a service implementation method based on the atomic granularity of attribute information is realized, which not only maximally reuses the atomic policies and improves the utilization rate of code segments, but also has clear implementation logic between various attribute information, is convenient for maintenance, and improves the service implementation efficiency.

[0095] The specific implementation manners do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for implementing a service, characterized in that, Including: In response to receiving an implementation request for a service, label the service according to the attribute information in the service to obtain a label set of the service; According to the labels in the label set, find corresponding atomic policies from a preset atomic policy factory, and perform instantiation processing on the atomic policies to obtain instantiated code corresponding to the labels; Establish logical relationships between the labels in the label set according to a preset general template; Execute the instantiated code corresponding to each label in the label set according to the logical relationship to implement the service.

2. The method according to claim 1, characterized in that, The labels in the label set have position information; Labeling the service according to the attribute information in the service includes: According to the attribute name of the attribute information, combined with a preset labeling specification, determine the position information of the label corresponding to the attribute information; According to the attribute value of the attribute information, determine the label stored at the position information.

3. The method according to claim 2, characterized in that, Determining the label stored at the position information according to the attribute value of the attribute information includes: Parse the attribute value according to a pre-configured configuration file; According to the parsing result, obtain the corresponding label, and store the label at the position information of the label set.

4. The method according to claim 1, characterized in that, Before finding the corresponding atomic policy from the preset atomic policy factory according to the labels in the label set, the method further includes: Define atomic policies corresponding to each attribute information with the attribute information of the service as the dimension, and construct an atomic policy factory; Determine the identifier of the atomic policy according to the attribute information corresponding to the atomic policy and a preset labeling specification, so as to find the corresponding atomic policy from the atomic policy factory according to the labels in the label set.

5. The method according to claim 1, characterized in that, Before performing instantiation processing on the atomic policy, the method further includes: Determine at least one implementation method corresponding to the atomic policy; Register a policy adapter corresponding to the atomic policy according to the implementation method; Performing instantiation processing on the atomic policy includes: Perform instantiation of the atomic policy through the adaptation of the label and the policy adapter.

6. The method according to claim 1, characterized in that, In the case where no corresponding atomic policy is found in the atomic policy factory, the method further includes: Determine a reference atomic policy from the atomic policy factory, and process the reference atomic policy through a hook method to obtain the atomic policy corresponding to the label.

7. The method according to claim 1, characterized in that, The label set of the service has version information; the method further includes: In response to receiving a service attribute information update request, label the service according to the updated service attribute information to obtain a corresponding updated label set, and record the version information of the updated label set.

8. An apparatus for implementing a service, characterized in that, Including: A label set generation module, configured to, in response to receiving an implementation request for a service, label the service according to the attribute information in the service to obtain a label set of the service; An atomic policy processing module, configured to find corresponding atomic policies from a preset atomic policy factory according to the labels in the label set, and perform instantiation processing on the atomic policies to obtain instantiated code corresponding to the labels; A logical relationship determination module, configured to establish logical relationships between the respective tags in the tag set according to a preset general template; A service implementation module, configured to execute the instantiated code corresponding to each tag in the tag set according to the logical relationships, so as to implement the service.

9. A mobile electronic device terminal, characterized in that, Including: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-7.

10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, the method according to any one of claims 1-7 is implemented.